- Sim res
- The size of the velocity grid the physics is computed on (the number is the shorter side; the longer side follows the canvas shape). Higher values resolve finer swirls and let the flow hug walls more tightly, but cost more GPU every frame. The colored dye always rides on a grid 4× finer than this, which is why the picture looks sharper than the physics underneath.
- Vorticity
- The strength of vorticity confinement: the numerical method quietly smooths away small whirls each step, and this control pumps energy back into them. At 0 the ink drifts smoothly and settles down; higher values keep eddies alive and make the motion look turbulent and smoky.
- Dye fade
- How quickly injected color dissipates. At 0 the ink never fades, it only mixes and spreads; higher values make it thin out and vanish like smoke in air.
- Pressure iters
- How many relaxation passes the pressure solver runs per frame to keep the fluid incompressible (so it flows around things instead of piling up). More passes give a stiffer, more accurate fluid, most visible when it squeezes through gaps and around walls; fewer passes are cheaper but mushier.
- Brush
- The size of the ink splat and of the wall/erase brush.
This is Jos Stam's classic "stable fluids" method, the same trick behind most real-time smoke and ink demos. Two textures ping-pong every frame: a coarse velocity field that drives the motion, and a separate, higher-resolution dye field that just rides along for the picture — which is why the colors look far more detailed than the underlying simulation grid. Each step advects both fields along themselves (semi-Lagrangian: it traces every cell backwards through the flow, which stays stable at any frame rate instead of blowing up), re-injects some of the curl that numerical diffusion quietly smooths away so eddies stay lively (vorticity confinement), then projects the velocity back to zero divergence by solving a discrete pressure Poisson equation with a couple dozen Jacobi relaxation passes and subtracting its gradient — the step that keeps the fluid incompressible, so nothing appears or vanishes anywhere on the grid. Switch the brush to Wall to paint solid obstacles the flow curls and splits around (Erase wall to remove them again, Clear walls to wipe the lot — plain Clear only resets the dye and motion); walls live on their own fine-grained grid, so their edges stay crisp and your drawing survives unchanged whatever the Sim res slider says. Use PNG or Record GIF to save a still image or a short looping clip of whatever you've made.