Builtin Library
- ..
- README.md1.2 KB
- bindings.yaml769 B
- shader.wgsl1.8 KB
README.md
terrain_delta_gather
Adds a neighbour tile's apron-ring erosion deltas into this tile's interior.
A droplet spawned in one tile's interior may walk into that tile's apron and deposit there. Those apron cells belong to the neighbour — the neighbour's interior is what carries the field's value for them — so the deposit has to reach the neighbour's accumulator before either tile folds its accumulator into height. Without this pass, every cell within a droplet's reach of a seam collects less material than the same cell away from one, and the seam shows as a band running through the eroded terrain.
The block is described in stored-cell coordinates, the same description
terrain_apron takes, so the two passes address the same geometry from
opposite ends: this one reads the neighbour's apron ring and adds into this
tile's interior band; terrain_apron reads the neighbour's interior and
overwrites this tile's apron ring.
The accumulation is a fixed-point integer add. Integer addition commutes, so a corner cell reached from three neighbours at once sums to the same value whichever dispatch lands first — which is what keeps a tiled erosion run reproducible.