Inland water: decode the water height texture and check it per tile #411

Manually merged
github merged 3 commits from github-bot/gh-411 into gh-pr/411/base 2026-11-27 00:40:21 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-26 21:15 UTC · original
holdmysocks:six-inland-height → master · +55 −4 · 2 files · 3 commits · merged 2026-11-26 23:20 UTC

Explains what an inland water tile's water height texture holds, and checks it on every tile.

  • A texel holds the water surface height relative to the tile's origin: z = origin z + (2 v - 1) * H. A texel of 0 means no water.
    • H is the largest distance of a surface vertex from the origin's height. Each tile gets it as shading.water_height_scale_m.
    • Flat tiles read 0.5. The texels with water cover the mesh and reach a little under the banks.
  • Each tile gets shading.water_height_check. The texture is sampled under every surface vertex and compared with the vertex height, giving the median and 95th-percentile error, the median value, and the share of texels with water.
  • Results on the real install, also in summary.water_height_texture_check:
    • On 319 of the 333 sloped tiles the median error is under 10% of H, and on 304 it is under 3%.
    • 473 of the 607 flat tiles read 0.5. The other 134, mostly river tiles near sea level, carry varying values over a flat mesh, and their scale isn't known.
  • The README documents the rule.

Tests: cargo check --workspace --all-targets and cargo test -p sixng-core -p sixng-gui --release pass.

**@⁠holdmysocks** on GitHub · 2026-11-26 21:15 UTC · [original](https://github.com/holdmysocks/SixNG/pull/411) `holdmysocks:six-inland-height` → `master` · +55 −4 · 2 files · 3 commits · merged 2026-11-26 23:20 UTC Explains what an inland water tile's water height texture holds, and checks it on every tile. - A texel holds the water surface height relative to the tile's origin: `z = origin z + (2 v - 1) * H`. A texel of 0 means no water. - `H` is the largest distance of a surface vertex from the origin's height. Each tile gets it as `shading.water_height_scale_m`. - Flat tiles read 0.5. The texels with water cover the mesh and reach a little under the banks. - Each tile gets `shading.water_height_check`. The texture is sampled under every surface vertex and compared with the vertex height, giving the median and 95th-percentile error, the median value, and the share of texels with water. - Results on the real install, also in `summary.water_height_texture_check`: - On 319 of the 333 sloped tiles the median error is under 10% of `H`, and on 304 it is under 3%. - 473 of the 607 flat tiles read 0.5. The other 134, mostly river tiles near sea level, carry varying values over a flat mesh, and their scale isn't known. - The README documents the rule. Tests: `cargo check --workspace --all-targets` and `cargo test -p sixng-core -p sixng-gui --release` pass.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:16:11 +00:00
# Conflicts:
#	README.md
#	crates/sixng-core/src/water.rs
github-bot changed target branch from master to gh-pr/411/base 2026-11-27 00:40:20 +00:00
github manually merged commit 2b5b1c009a into gh-pr/411/base 2026-11-27 00:40:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.