Drag to inject dye and velocity. Try fast flicks. Hold still for the idle currents.
Real-time fluid dynamics on the GPU.
FLUX solves the incompressible Navier–Stokes equations entirely on the GPU. Every frame runs a chain of fragment-shader passes: advect the velocity field through itself with a semi-Lagrangian step, compute curl and inject vorticity confinement so the small eddies don’t die, compute divergence, solve for pressure with a Jacobi relaxation, subtract the pressure gradient to make the field divergence-free, then advect the dye through the corrected velocity.
The velocity grid runs at 256² in half-float textures; the dye runs at up to 1024² so the edges stay crisp. The pressure solve is the expensive part: 24 Jacobi iterations per frame, each a full-screen pass over the sim grid. Nothing is allocated after the first frame, and every pass is a single fullscreen triangle. On an integrated GPU this holds 60 fps with room to spare.
Rendering samples the dye texture, lifts a fake surface normal from its gradient, and shades it with a rim light so the fluid reads as something with body rather than a blurred blob. The same ordered dither as the rest of the site keeps the look consistent.