clampSplatGridSize

The grid size pointerSplatField really uses for a prop value: floored, then held to 8–128.

clampSplatGridSize(v: number): number

Import effects from shaders/std and use effects.pointerFields.clampSplatGridSize.

Use it in the gridSize prop's recompile rule, so the simulation rebuilds only when the cell count changes and not on every drag of the slider.

Parameters

NameTypeNotes
vnumber

Example

gridSize: {default: 20, recompile: recompileWhen((prev, next) => clampSplatGridSize(prev as number) !== clampSplatGridSize(next as number))}

See also

  • pointerSplatField — A field the cursor smears: cells near the pointer move with it, then fade back to rest.

Used by

GridDistortion