PRO

Lava Particle Field

A GPU particle solver where the particles live in the texture itself. Buffer A stores one particle per texel as position in RG and velocity in BA, and advances it by sampling its eight neighbours and adopting whichever one is closer under a wrapped distance, which is how particles are handed between texels without any CPU-side list. Buffer B accumulates density and pressure from that field, and its gradient is fed back into A on the next frame, so the two ping-pong: motion writes density, density pushes motion. The image pass reads out vorticity, the curl of the velocity field, and maps it straight to the lava colour, so what you see is rotation rather than heat. Four double-buffered FloatType targets at twice display resolution; press and drag to inject a gaussian of velocity.

Component

GPU particle solver

Press and drag

Install
npx shadcn@latest add https://ui.aryank.space/r/lava-particle-field.json

Installs from ui.aryank.space. To add it by hand, copy the files in Usage below, or register the @compronents namespace via the docs.

Files

API
PropTypeDefaultDescription
resolutionScalenumber2Simulation runs at this multiple of display size. Particle count is one per simulation texel, so halving this quarters the work.
brand / experimentLabel / footerLeft / footerRightstringBLANK copyOverlay chrome above the canvas.
Customize
resolutionScaletext

Simulation resolution as a multiple of display size.

experimentLabeltext

Label at the top right.

Dependencies
three