Map 3D: cloud noise baked once into a repeating texture (cheaper clouds) #361

Manually merged
github merged 2 commits from gh-pr/361/head into gh-pr/361/base 2026-11-26 20:30:27 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-26 06:00 UTC · original
holdmysocks:six-map3d-cloudtex → master · +138 −18 · 3 files · 2 commits · merged 2026-11-26 06:54 UTC

The clouds' cover noise (four octaves of value noise) used to be computed for every sample along every cloud ray, and again for the light through the cloud above each sample and for the cloud shadow on every lit surface. It is now baked once at start into a 2048² half-float texture that repeats every 32 noise cells (80 km, farther than the clouds are drawn). Each of those lookups becomes one filtered texture read.

  • atmo.rs: the bake (the shader's hash and value noise with the lattice wrapped per octave, so the texture tiles), plus bindings 26 (texture) and 27 (repeating sampler) in the scene's part of group 0.
  • shader.wgsl: cloud_density reads the texture; the analytic noise is removed.
  • Octaves now scale by exactly 2 (was 2.03) so the bake tiles. The clouds look the same but sit in slightly different places.
  • Test: cloud_noise_tiles (the noise wraps at the period, and the baked range covers the cover threshold's range).

To verify on the second PC: GPU main pass time at w1 with and without --no-clouds, against #339's +6.8 ms; and the look (no tiling, no blockiness at the edges, the same amount of cloud).

**@⁠holdmysocks** on GitHub · 2026-11-26 06:00 UTC · [original](https://github.com/holdmysocks/SixNG/pull/361) `holdmysocks:six-map3d-cloudtex` → `master` · +138 −18 · 3 files · 2 commits · merged 2026-11-26 06:54 UTC The clouds' cover noise (four octaves of value noise) used to be computed for every sample along every cloud ray, and again for the light through the cloud above each sample and for the cloud shadow on every lit surface. It is now baked once at start into a 2048² half-float texture that repeats every 32 noise cells (80 km, farther than the clouds are drawn). Each of those lookups becomes one filtered texture read. - `atmo.rs`: the bake (the shader's hash and value noise with the lattice wrapped per octave, so the texture tiles), plus bindings 26 (texture) and 27 (repeating sampler) in the scene's part of group 0. - `shader.wgsl`: `cloud_density` reads the texture; the analytic noise is removed. - Octaves now scale by exactly 2 (was 2.03) so the bake tiles. The clouds look the same but sit in slightly different places. - Test: `cloud_noise_tiles` (the noise wraps at the period, and the baked range covers the cover threshold's range). To verify on the second PC: GPU main pass time at w1 with and without `--no-clouds`, against #339's +6.8 ms; and the look (no tiling, no blockiness at the edges, the same amount of cloud).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:30:25 +00:00
github manually merged commit 2fade2d25c into gh-pr/361/base 2026-11-26 20:30:27 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.