stage.host

A named step that runs before any gate: pointer smoothing, activity flags, anything a later settle needs to know.

stage.host(name: string, run: (f: GridFrame) => void): GridStage

Import sim from shaders/std and use sim.grids.stage.host.

Parameters

NameTypeNotes
namestring
run(f: GridFrame) => void

Example

stage.host('cursor', (f) => { active = (f.frameParams.pointer?.x ?? 0.5) !== lastX })

See also

  • stage.values — A named step that writes this frame's values for the passes after it.
  • stage.settle — Sleep the simulation once nothing has driven it for settleMs of simulated time.