snow_stamp.computeShader
- .metadata17 B
- README.md815 B
- bindings.yaml138 B
- shader.wgsl4.4 KB
README.md
snow_stamp
Cuts ski strokes into a persistent snow deformation field. One thread per field
cell: it adds this frame's strokes to the standing deformation in acc — a
trough under the edge and a bank of thrown snow alongside it. Because acc
persists between dispatches, the trail is the sum of every stroke ever cut
rather than only the current one, which is what lets a run be carved live
instead of authored in advance.
ctrl opens with grid size, field extent in metres, stroke count and a spare,
then carries the strokes: segment start x, z, segment end x, z, half width,
depth, berm gain, and hardness. Dispatch one workgroup per 8x8 block of cells.
The field is laid out to match the terrain's vertex grid one cell per vertex, so
snow_carve can lift vertex i by acc[i] with no resampling.