Water export: fog atlas, water height map, shoreline grid, ocean and wave settings (SIX-197) #254

Manually merged
github merged 2 commits from gh-pr/254/head into gh-pr/254/base 2026-11-26 20:21:52 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 06:49 UTC · original
holdmysocks:six-197-water → master · +1390 −0 · 4 files · 2 commits · merged 2026-11-25 06:59 UTC

Adds sixng water: the water system of the world, placed in world space (SIX-197).

What it exports (-o <dir> writes <dir>/water/)

  • Water fog atlas (textures.rpf): RGB scattering and extinction per texel, as f32 mosaics (--fog-px texels per 512 m cell, default 32), the fallbacks, and cells.json with both terms per cell and their source (tile or fallback).
  • Water height map (levels.rpf): ground, roofs and seabed, 1 m per texel in the tiles; a 16-bit mosaic (--height-px, default 128 = 4 m), --height-tiles for every tile at 1 m. Height = (v − 0.5) × 1600 m.
  • Shoreline wave grid (levels.rpf): every tile at 2 m as RGBA PNG named by cell, a mosaic and the fallback, with the channel packing documented.
  • The four GridAtlasInfo grids, OceanSimPresets, OceanWaveCalmingCurves, PatchConstants and ShoreWavePlacementData as JSON.
  • Every water_* timecycle key: 71 variables over the 27 weather cycles (per region and time sample) and the 302 modifiers that set any.

Placement. All layers share a 32 × 66 grid of 512 m cells. Tiles are dictionaries stored in decimal-string order of their cell numbers; which cells have one is not stored. The export aligns the stored tiles with the string-ordered cells against each grid's fallback texture, then checks every shared edge.

Counts and checks on the install

layer tiles placed continuous seams seam difference vs unrelated tiles
fog scattering 1,313 1,312 (cells 800..2111) 2,009 / 2,037 1/200
fog extinction (same) (same) 1,544 / 1,555 1/180
height 738 738 1,396 / 1,400 1/470
shore 268 268 268 / 271 1/28
  • Height scale against the terrain height map (sixng heightmap): slope 1,599 m, offset −1.1 m, correlation 0.998 over 4.7 M land samples.
  • Shore channels against ShoreWavePlacementData: wave group 99.6 % of 21,157 samples, the type-4 flag 8,961 / 8,965; correlations 0.84 (distance across the band), −0.90 / 0.88 (G / A against the direction), 0.69 (R against the along-shore coordinate).
  • Fog units: × 1000 equals the timecycle water_clip_* units (open-sea extinction (8.05, 6.64, 6.65) against the cycles' (11.19, 6.60, 6.60)); inferred.
  • The height (R16) and shore (B8G8R8A8) tiles are stored in SW_4KB_S blocks; the module untiles them with the Gfx10 layout. texture.rs is unchanged.

Open

  • One fog tile, stored after every numbered tile, is not placed; probably the map-swap override.
  • How the game picks an OceanSimPresets entry for a place is not decoded.

Format description: module docs of crates/sixng-core/src/water.rs and the new README paragraph. About 30 s per run; needs the common, textures and levels indexes at the current index version.

**@⁠holdmysocks** on GitHub · 2026-11-25 06:49 UTC · [original](https://github.com/holdmysocks/SixNG/pull/254) `holdmysocks:six-197-water` → `master` · +1390 −0 · 4 files · 2 commits · merged 2026-11-25 06:59 UTC Adds `sixng water`: the water system of the world, placed in world space (SIX-197). **What it exports** (`-o <dir>` writes `<dir>/water/`) - **Water fog atlas** (textures.rpf): RGB scattering and extinction per texel, as f32 mosaics (`--fog-px` texels per 512 m cell, default 32), the fallbacks, and `cells.json` with both terms per cell and their source (tile or fallback). - **Water height map** (levels.rpf): ground, roofs and seabed, 1 m per texel in the tiles; a 16-bit mosaic (`--height-px`, default 128 = 4 m), `--height-tiles` for every tile at 1 m. Height = (v − 0.5) × 1600 m. - **Shoreline wave grid** (levels.rpf): every tile at 2 m as RGBA PNG named by cell, a mosaic and the fallback, with the channel packing documented. - The four `GridAtlasInfo` grids, `OceanSimPresets`, `OceanWaveCalmingCurves`, `PatchConstants` and `ShoreWavePlacementData` as JSON. - Every `water_*` timecycle key: 71 variables over the 27 weather cycles (per region and time sample) and the 302 modifiers that set any. **Placement.** All layers share a 32 × 66 grid of 512 m cells. Tiles are dictionaries stored in decimal-string order of their cell numbers; which cells have one is not stored. The export aligns the stored tiles with the string-ordered cells against each grid's fallback texture, then checks every shared edge. **Counts and checks on the install** | layer | tiles | placed | continuous seams | seam difference vs unrelated tiles | |---|---|---|---|---| | fog scattering | 1,313 | 1,312 (cells 800..2111) | 2,009 / 2,037 | 1/200 | | fog extinction | (same) | (same) | 1,544 / 1,555 | 1/180 | | height | 738 | 738 | 1,396 / 1,400 | 1/470 | | shore | 268 | 268 | 268 / 271 | 1/28 | - Height scale against the terrain height map (`sixng heightmap`): slope 1,599 m, offset −1.1 m, correlation 0.998 over 4.7 M land samples. - Shore channels against `ShoreWavePlacementData`: wave group 99.6 % of 21,157 samples, the type-4 flag 8,961 / 8,965; correlations 0.84 (distance across the band), −0.90 / 0.88 (G / A against the direction), 0.69 (R against the along-shore coordinate). - Fog units: × 1000 equals the timecycle `water_clip_*` units (open-sea extinction (8.05, 6.64, 6.65) against the cycles' (11.19, 6.60, 6.60)); inferred. - The height (R16) and shore (B8G8R8A8) tiles are stored in `SW_4KB_S` blocks; the module untiles them with the Gfx10 layout. `texture.rs` is unchanged. **Open** - One fog tile, stored after every numbered tile, is not placed; probably the map-swap override. - How the game picks an `OceanSimPresets` entry for a place is not decoded. Format description: module docs of `crates/sixng-core/src/water.rs` and the new README paragraph. About 30 s per run; needs the common, textures and levels indexes at the current index version.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:21:50 +00:00
github manually merged commit 9814e5d8f5 into gh-pr/254/base 2026-11-26 20:21:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.