scene: terrain fine grain domain-warped so it stops reading as hatching #66

Merged
void merged 1 commit from nibu/terrain-hatching into dev 2026-11-10 14:09:23 +00:00
Member

Draft for Void, stacked on #65 (head 9d3343bb). Base is void/nemesis-demo-tests so the diff is this one commit.

Cause (from code, confirmed by render): the fine albedo grain (terrainAlbedo.ts FINE, terrainShaders.ts fine) is three plane waves per projection plane, periods about 5 m. A sum of plane waves is a regular lattice. At near-ground pixel size (about 0.1 m/px) it is resolved, not aliased, so it reads as diagonal hatching; the 768/2048 grid made it sharper, not different. Strata (sin(y*0.9), horizontal bands on rock only) and the mesh are not the source.

Evidence (SwiftShader, 390x844, tier=full, noonday; shots in /opt/commons/handoff/rat-terrain-hatching-20261110/): base shows the lattice; grainFine: 0 removes it; coarse-off still shows it (variants run in scratch copies, not committed).

Fix: the fine octave's coordinates are pushed by a slower sine (fineWarp 7 m, 0.55/0.47 rad/m) in wavesWarped and the shader's warpq, so the stripes break up. First try (3 m, 0.31/0.27) left wavy stripes; this one reads as organic grain.

Tests: scene vitest 394 pass (the one failing suite in my staged copy is a missing Editor.css in the stage, not the change). Shader twin pinned by a define/usage test; no pixel test. No GPU render: SwiftShader only. Not touched: sky floor, nemesis/demo, dev.

Not done: a numeric twin check of grainAt vs the shader on GPU.

Draft for Void, stacked on #65 (head 9d3343bb). Base is void/nemesis-demo-tests so the diff is this one commit. **Cause (from code, confirmed by render):** the fine albedo grain (`terrainAlbedo.ts` FINE, `terrainShaders.ts` `fine`) is three plane waves per projection plane, periods about 5 m. A sum of plane waves is a regular lattice. At near-ground pixel size (about 0.1 m/px) it is resolved, not aliased, so it reads as diagonal hatching; the 768/2048 grid made it sharper, not different. Strata (`sin(y*0.9)`, horizontal bands on rock only) and the mesh are not the source. **Evidence (SwiftShader, 390x844, tier=full, noonday; shots in /opt/commons/handoff/rat-terrain-hatching-20261110/):** base shows the lattice; `grainFine: 0` removes it; coarse-off still shows it (variants run in scratch copies, not committed). **Fix:** the fine octave's coordinates are pushed by a slower sine (`fineWarp` 7 m, 0.55/0.47 rad/m) in `wavesWarped` and the shader's `warpq`, so the stripes break up. First try (3 m, 0.31/0.27) left wavy stripes; this one reads as organic grain. Tests: scene vitest 394 pass (the one failing suite in my staged copy is a missing Editor.css in the stage, not the change). Shader twin pinned by a define/usage test; no pixel test. No GPU render: SwiftShader only. Not touched: sky floor, nemesis/demo, dev. Not done: a numeric twin check of grainAt vs the shader on GPU.
scene: terrain fine grain domain-warped so its plane waves stop reading as hatching
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m30s
384cd17dac
The fine albedo octave is three plane waves per projection (about 5 m periods): a regular lattice, resolved
(not aliased) at near-ground pixel size, so it reads as diagonal hatching. Switching the octave off in a SwiftShader
render removes it; coarse grain off does not. The octave's coordinates are now pushed by a slower sine each, in
terrainAlbedo.wavesWarped and the shader's warpq.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
nibu changed title from scene: terrain fine grain domain-warped so it stops reading as hatching to WIP: scene: terrain fine grain domain-warped so it stops reading as hatching 2026-11-10 14:00:56 +00:00
void changed title from WIP: scene: terrain fine grain domain-warped so it stops reading as hatching to scene: terrain fine grain domain-warped so it stops reading as hatching 2026-11-10 14:09:19 +00:00
void changed target branch from void/nemesis-demo-tests to dev 2026-11-10 14:09:19 +00:00
void merged commit 854b151d80 into dev 2026-11-10 14:09:23 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Ratatoskr!66
No description provided.