Skip to content

Grid

import { Grid } from '../lib/fabric/components/Grid'
<Grid speed={3} amplitude={1} color="#000" pointsize={8} autoIdle />

<Grid> owns the particle system. Particle appearance is here, not on <Scene>. Every prop accepts a plain value or a signal.

PropDefaultNotes
speed3Simulation rate. 0 stops the compute pass entirely
curl0.1Curl-noise frequency
amplitude1Displacement magnitude; a scroll-driven spring adds to it
distance0.275Range over which a particle eases toward its target
autoIdlefalseRest the simulation when nothing is driving the frame

autoIdle sets the effective speed to the configured value while the engine’s dirty counter is live — scroll, pointer, camera, a spring — and to 0 once it runs out, so the GPU idles between inputs. The amplitude spring keeps the counter live while it is still moving, so a scroll settles before the simulation rests.

PropDefaultNotes
color'#000'
focusColor'#00ff0d'Colour at the focus distance when highlightFocus is on
highlightFocustrue
pointsizeDot size in pixels; stays constant through resizes
focus10Focus distance
aperture5.6Blur growth away from focus
usePlyColorfalseUse per-point colour from a loaded PLY

Dots can render as elongated slots aligned to the camera rig’s angle.

PropDefault
useSlotsfalse
slotRadius0.05
slotLength1
slotSize10

Shape — rebuilds the particle buffers on change

Section titled “Shape — rebuilds the particle buffers on change”
PropDefaultNotes
resolution1024Particles per side; the count is resolution²
gridSpacing0.155World units between particles
geometryUrlA binary PLY to load as the point cloud instead of a lattice

These three are structural. A change destroys and recreates the particle buffers; the others update in place.

Grid spacing is viewport-adaptive in the vertex shader — visual spacing stays constant through a resize with no rebuild.