FluidLab

Water simulation, stirred by hand

A cooler, slower fluid than the default: long filaments that keep their shape, low drag so the current keeps moving after you stop, and a palette that reads as water rather than smoke.

Drag to stir · click for a splash

This browser can’t run the WebGL2 simulation.
Try the latest Chrome, Edge, Firefox or Safari on desktop.

— fps · …

What you can do

01 · the look

Long filaments, not puffs

Water keeps its shape after you stop pushing. This preset drops dye fade to 0.16 and drag to 0.18, so a stroke stays as a coherent ribbon instead of dissolving into smoke.

02 · the push

A click is a drop, a drag is a current

Clicking injects a short impulse and a dot of colour. Dragging lays down velocity along your path, which is what makes the trailing curls downstream.

03 · the exit

Record or hand over the setup

Record 5s saves a WebM straight from the canvas. Copy link packs every slider into the URL, so someone else opens the exact same water.

How it works

Why water reads differently from smoke

All presets run the same solver; what changes is how fast colour fades and how much the velocity field resists being pushed. Water sits at the “slow fade, low drag” corner, which keeps thin filaments alive long enough for you to see them bend around each other.

The cool palette does the rest. Because the dye is added in additive colour space, overlapping strokes climb towards white — that is where the bright crests come from, not from any lighting model.

What this is, and what it is not

This is a two-dimensional, incompressible visual model: a Stable Fluids solver with a pressure projection step, rendered as dye on a black background. It is genuinely solved every frame — nothing is pre-rendered — but it is not a free-surface solver, so it will not give you wave height, spray or a shoreline.

If you need surface geometry, splash particles or measured quantities, the honest answer is that a browser playground is the wrong tool; a real CFD package is. What this page is good for is intuition: watch how a jet curls, where recirculation forms, and how fast a disturbance dies out when you raise the drag.

Three sliders that make it feel like water

Dye fade down to roughly 0.15 — the ribbon survives seconds instead of frames. Flow drag down to about 0.2 — momentum keeps travelling after your hand stops. Swirl up to 30–40 — the vorticity confinement pass puts back the small curls that numerical diffusion would otherwise smooth away.

Push drag too low and the field never settles; push swirl too high and the whole canvas boils. The presets are just three points in that space, not the only good ones.

FAQ

Is this real water physics?

It solves an incompressible 2D flow field every frame (advection, divergence, pressure projection, gradient subtraction). It does not model a free surface, surface tension or spray, so treat it as a fluid-intuition sandbox rather than a wave simulator.

Why does it run at 60fps on a laptop?

The solver grid is small — roughly 256×160 on desktop — and the visible dye is advected at a higher resolution. That split is what keeps the frame budget low while the picture still looks detailed.

Can I use the recorded clip in a video?

Yes, for personal and educational use. Everything runs locally in your browser; nothing is uploaded. For commercial licensing, get in touch before you ship it.

Does it work on a phone?

Yes. Touch drags inject velocity the same way a mouse does, and the grid drops to 112 cells on the short edge when the screen is small.