Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld db2c16ac-a…

snow

<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->

byzero-proxy @ DESKTOP-DB3UJOJ·posted 3mo ago
What it does

snow

<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->

TODO: describe this module.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

Live GPU snow: ski strokes carve a deformation field, and a clipmap mesh is lifted onto it every frame. The trail persists for the whole run.

attach(opts: ?) → void

Stand the snow up. `opts`: heights the landform's height array, row-major landGrid its grid width, `landExtent` its size in metres fieldGrid the deformation field's grid width, `fieldExtent` its metres clipCells the clipmap's resolution, `clipHalf` its reach in metres clipSpacing the cell size the clipmap has at its centre, in metres material the material the snow renders with

argtypedescription
opts?

recentre(x: number, z: number) → void

Move the clipmap so its dense middle sits under the action. Snapped to the field's own cells, so the surface does not swim as the mesh slides.

argtypedescription
xnumber
znumber

cut(strokes: ?) → void

Cut a list of strokes into the snow. Each stroke is { ax, az, bx, bz, halfWidth, depth, bermFraction, hardness } in field metres. Call once per frame — a second call in the same frame overwrites the first before either dispatch has run.

argtypedescription
strokes?

frame( ) → void

Lift the clipmap onto the current surface. Run once per frame, after cut.

requestLand( ) → boolean

Ask the GPU for the landform. The read is held here and drained by `receiveLand`, so a caller only has to keep asking until it says yes.

receiveLand( ) → boolean

Take the landform read started by `requestLand`. Returns true once the heights are cached and `heightAt` can be used, and false while the read is still on its way — a read takes frames to arrive.

heightAt(x: number, z: number) → number

Surface height at a world XZ, bilinear over the cached landform. Nil until `receiveLand` has succeeded. This is the landform only — the carve the skis cut is not in it, which is what you want for a skier riding the run rather than sinking into their own track.

argtypedescription
xnumber
znumber

spacingAt(r: number) → number

The distance between neighbouring render vertices `r` metres from the clipmap's centre. Anything placed on the snow needs it: the carve pass filters the landform against this spacing, so the drawn surface is a smoothed version of the height buffer and the smoothing widens with range.

argtypedescription
rnumber

landBuffers( ) →

The two landform buffers, so the generator writes the same storage the carve reads. `near` is the fine one the skier rides and `far` carries the ground out past anything the camera can see.

active( ) → boolean

Whether a snow surface is currently standing.

release( ) → void

Drop the snow's GPU buffers and its mesh entity.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

12+items
·
computeshader · born here
❒asset
# 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.
▲ 0↑ born
▣
module · born here
❒asset
# clipmap <!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. --> TODO: describe this module.
▲ 0↑ born
·
computeshader · born here
❒asset
# snow_carve Puts the snow surface onto the clipmap mesh, one thread per vertex. Each vertex looks the surface up by **where it is** — bilinear reads of a coarse landform buffer and a fine deformation buffer at its world XZ — rather than by which vertex it is. That indirection is the whole point. Sampling by vertex index welds the field's resolution to the mesh's vertex count, so a 7 cm ski track forces 9 cm cells across the entire surface. Sampling by position lets the deformation field be as fine as the track needs while the mesh carries only the vertices the frame can afford, and lets the mesh slide with the action without dragging the snow along with it. The normal is rebuilt from the same sampled surface, which is what makes a carved track shadow itself and hold a silhouette. Expects the 32-byte packed vertex layout: position as three floats, then the normal as `snorm8x4`.
▲ 0↑ born

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.