snow
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
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/v2Live 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
| arg | type | description |
|---|---|---|
| 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.
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
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.
| arg | type | description |
|---|---|---|
| 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.
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
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.
| arg | type | description |
|---|---|---|
| r | number |
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.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.