op.splat

A brush step: a soft round push into the grid at the pointer, scaled by how fast it moves.

op.splat(config: {at: PointerSignal; amount: PointerSpeedSignal; radius: PropRef}): SplatOp

Import op from shaders/std and use op.splat.

radius is a prop on a 0.1–1 scale.

Parameters

NameTypeNotes
config{at: PointerSignal; amount: PointerSpeedSignal; radius: PropRef}

Example

op.splat({at: pointer({teleportGuard: 'on'}), amount: pointerSpeed({max: 2}), radius: p('radius')})

Tip. Use pointer({teleportGuard: 'on'}). The pointer entering the canvas is then not a stroke.

See also

  • op.wave — A wave step: the grid ripples outward from any disturbance and fades by damping (a prop, 0–20).
  • ctx.pointer — The mouse position in uv (0–1, y down).
  • pointerSpeed — The pointer's speed, capped at max, as the strength of a simulation step.

Used by

CursorRipples