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

trail

<!-- 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

trail

<!-- 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

The ski trail: a ribbon of its own, dense along the track and shaped across it, lifted onto the snow by a compute pass every frame.

retireHandover( ) → void

sweepEntity( ) → void

Sweep the ribbon entity by NAME. Editing this module resets `state`, so a teardown that only knew about the tracked entity would orphan the ribbon the previous copy spawned.

attach(opts: ?) → void

Stand a trail up. `segments` is how many frames of track the ring holds, `across` how many vertices span its cross-section.

argtypedescription
opts?

claim(name: string, len: number) → void

Editing this module resets `state`, so a copy that always allocated would leave the previous one's buffers with nothing holding them and hand the GPU a fresh pair every reload. The shader remembers what it made under each name, so a buffer of the right length is taken over and reused; only a changed length allocates, and the old one goes when it does.

argtypedescription
namestring
lennumber

flush( ) → void

Push any batched samples into the ring.

frame( ) → boolean

Shape the ribbon from the track so far. Run once per frame, after `append`.

active( ) → boolean

Whether a trail is currently standing.

written( ) → number

How many samples have been appended in total. The ring index of the newest sample is this minus one, taken modulo the ring's length.

track( ) → any

The ring the track is written into, so a second pass over other geometry reads the same samples this one shapes the rope from. The ground's trench and the rope beside it are one carve seen twice, and they stay one carve by sharing the track rather than each keeping its own copy of it.

ring( ) → number

How many samples the ring holds.

release(handover: boolean?) → void

Drop the trail's buffers and its mesh entity. `handover` means a rebuild is following, so the mesh is retired rather than destroyed and goes once its replacement is standing.

argtypedescription
handoverboolean?
⌬ Types
Shape = {

Sub-parts

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

9items
·
computeshader · born here
❒asset
# snow_trail The ski trail, as its own geometry: a ribbon dense along the track and shaped across it, lifted into place by one compute dispatch a frame. ## What it has to look like Read off the reference (a snowboarder carving deep snow, low sun across the slope). Each line is a claim the geometry has to answer, and the whole point of writing them down is that "closer than it was" is not one of them. 1. **The displaced snow is a ROLLED ROPE, not a bank.** The outside of the turn carries a thick, round, continuous roll of snow — a tube lying on the surface, its top clearly above the untouched snow around it. It is the largest thing in the frame after the rider: of the order of a metre thick, comparable to the rider's own body. A smooth swell a few centimetres proud is not this. 2. **One broad trough, not two grooves.** In snow this deep the track is a single smooth trough the width of the board, its floor in blue shadow, its far wall rising into the roll. Two thin parallel grooves belong to a groomed piste, not to this. 3. **The roll is asymmetric.** Nearly all of the displaced snow is on the OUTSIDE of the turn. The inside has a small lip at most. 4. **The trough floor is smooth and the roll is granular.** The compressed floor reads as polished; the roll reads as broken clods, because it is snow that has been thrown rather than pressed. 5. **The roll overhangs its own base.** Its outer face is steeper than the snow would stand at, because it was pushed there — it is not a pile that settled. 6. **The trail persists and reads at distance.** Earlier parts of the track are visible across the slope as a thinner line, so the shape has to survive being small on screen as well as filling it. 7. **Depth follows the turn.** Where the turn is hardest the trough is deepest and the roll is biggest; where the track runs straight both fall away to almost nothing. The reference frame itself lives in the conversation that set this work off; what is durable is the list above, which is what a capture gets held against. ## How it is driven The CPU appends one track sample per frame into a RING buffer, so the trail runs for ever rather than filling up: the ribbon's first segment is always the newest sample and the rest trail backwards through the buffer. Old samples settle as they age, because snow relaxes. Dispatch it over the ribbon's vertices, `ceil(count / 64)` groups. ## Buffers | binding | name | role | |---------|------|------| | 0 | `vertices` | the ribbon's vertex buffer, written in place | | 1 | `track` | the ring of track samples, 8 floats each | | 2 | `ctrl` | the parameters below | ## A track sample | slot | meaning | |------|---------| | 0, 1 | centre x, z | | 2, 3 | unit vector across the track | | 4 | ground height at the centre | | 5 | edge load, 0..1 | | 6 | cross slope, metres of rise per metre across | | 7 | which way the turn is loaded, -1 or +1 | ## `ctrl` | slot | meaning | |------|---------| | 0 | vertex count | | 1 | vertices across the ribbon | | 2 | samples written in total (the ring's head) | | 3 | segments the ribbon has | | 4 | trough half width at full load | | 5 | roll width | | 6 | roll height at full load | | 7 | trough depth at no load | | 8 | trough depth added at full load | | 9 | how far the roll overhangs its base, 0..1 | | 10 | how much of the roll is clods, in metres | | 11 | inside lip as a fraction of the roll | | 12 | samples over which an old track settles | | 13 | how much of its depth a settled track keeps |
▲ 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. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬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.