Water: take the inland height texture's scale from the drawable's stored bounds #534

Manually merged
github merged 2 commits from github-bot/gh-534 into gh-pr/534/base 2026-11-28 04:51:42 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-28 04:32 UTC · original
holdmysocks:water-flat-scale → master · +19 −10 · 2 files · 2 commits · merged 2026-11-28 04:45 UTC

The inland water height texture decodes as z = origin z + (2 v - 1) * H. sixng water --inland now takes H from the drawable's stored bounding box instead of measuring it from the mesh. This settles the known gap of the flat tiles whose scale wasn't known.

  • H is the top of the bounding box, which each tile now lists as model_bounds. On all 940 tiles with a height texture it matches the old measure, the largest distance of a surface vertex from the origin's height, to within 1 cm. On the sloped tiles they agree exactly.
  • Flat tiles:
    • Their box top is under 1 cm; flat tiles store it a hair below 0, and the export reads that as 0.
    • Of the 571 flat tiles, 465 read 0.5 under the surface.
    • The other 106 carry varying values over a flat mesh. Those values only span millimetres of relief: decoded with H, they lie within 2.4 mm of the mesh. So the varying values do not hide a lost height scale.
  • The skirt: the box bottom is -(H + d), where d is the unnamed constant 02596957 (3 to 60 m). That is the depth of the skirt below the surface, on 886 of the 940 tiles. Its name is still unknown.
  • Sloped tiles: on 347 of the 369, the median error is under 10% of H, and on 325 it is under 3%.
  • Output: water_height_check gains scale_from (bounds, or vertices when a drawable has no bounds) and vertex_distance_m. The notes in inland.json and the README say the same.

Tests: cargo check --workspace --all-targets and cargo test -p sixng-core -p sixng-gui --release pass. The --inland export was run on the real install.

**@⁠holdmysocks** on GitHub · 2026-11-28 04:32 UTC · [original](https://github.com/holdmysocks/SixNG/pull/534) `holdmysocks:water-flat-scale` → `master` · +19 −10 · 2 files · 2 commits · merged 2026-11-28 04:45 UTC The inland water height texture decodes as `z = origin z + (2 v - 1) * H`. `sixng water --inland` now takes `H` from the drawable's stored bounding box instead of measuring it from the mesh. This settles the known gap of the flat tiles whose scale wasn't known. - `H` is the top of the bounding box, which each tile now lists as `model_bounds`. On all 940 tiles with a height texture it matches the old measure, the largest distance of a surface vertex from the origin's height, to within 1 cm. On the sloped tiles they agree exactly. - **Flat tiles:** - Their box top is under 1 cm; flat tiles store it a hair below 0, and the export reads that as 0. - Of the 571 flat tiles, 465 read 0.5 under the surface. - The other 106 carry varying values over a flat mesh. Those values only span millimetres of relief: decoded with `H`, they lie within 2.4 mm of the mesh. So the varying values do not hide a lost height scale. - **The skirt:** the box bottom is `-(H + d)`, where `d` is the unnamed constant `02596957` (3 to 60 m). That is the depth of the skirt below the surface, on 886 of the 940 tiles. Its name is still unknown. - **Sloped tiles:** on 347 of the 369, the median error is under 10% of `H`, and on 325 it is under 3%. - **Output:** `water_height_check` gains `scale_from` (`bounds`, or `vertices` when a drawable has no bounds) and `vertex_distance_m`. The notes in `inland.json` and the README say the same. Tests: `cargo check --workspace --all-targets` and `cargo test -p sixng-core -p sixng-gui --release` pass. The `--inland` export was run on the real install.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 04:37:56 +00:00
github-bot changed target branch from master to gh-pr/534/base 2026-11-28 04:51:39 +00:00
github manually merged commit ba692c06a4 into gh-pr/534/base 2026-11-28 04:51:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.