frameSway
A slight drifting shift and rotation of where the child is read from, like film in an unsteady projector gate.
frameSway(slots: {amount: PropRef; field: string}): (params: GpuFragmentParams) => Expr
Import effects from shaders/std and use effects.blurs.frameSway.
amount is a prop from 0 to 1. field names an entry you declare in the definition's extraFields as {schema: schema.f32, initial: 0}; the sway's clock lives there. Returns a function of the fragment params that gives the uv to sample the child at. When amount drops to 0 the motion freezes in place rather than snapping back.
Parameters
| Name | Type | Notes |
|---|---|---|
slots | {amount: PropRef; field: string} |
Example
const weave = frameSway({amount: p('weave'), field: 'weaveTime'})
Tip. Build it once at module level and call it inside
gpu.fragment; it registers its own per-frame clock.
See also
screenedBloom— A tinted glow of the child's bright parts, screened over a color you have already graded: film halation, phosphor bloom.