Feature Library

Living paint behind the UI

3.73 GPU · 0.12 CPU ms
A still of the Living paint behind the UI demo
Still
The live demo starts when it’s in view.Drag to pour · click to burst · drag a card by its handle

A stable-fluids simulation in WebGPU compute, nothing read back, with the page’s own panels as obstacles the paint flows round and a moving panel pushing it aside.

What it costs a frame

3.73 ms
0.12 ms
GPU
3.73 ms
CPU, median
0.12 ms
CPU, 95th pct
0.17 ms
Draw calls
0
Weight
Heavy

Measured 11 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured with the ambient jets on and a burst every 1.5 s, so the paint steps every frame: a 256 × 144 motion grid (curl, velocity with three panel obstacles, divergence, 21 pressure passes, gradient), the colour advected on 1024 × 576 and a quarter-size glow, then the full-screen powder shading with the panels’ shadows and their membrane, timed with timestamp queries. At rest it draws nothing. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool3.730.120.17
apple · Apple A19 Proin a browser tab · 16 November 20269.620.260.34
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20261.250.230.36

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

How steadily it runs on Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258V · in a browser tab

Typical frame ?
16.67 ms
1% low ?
54 fps
Varies by ?
±0.44 ms
All metricsIntel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258V · in a browser tab
p50p95p9916.04 ms18.03 ms +
How long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.

Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.

Frames

Median (p50) ?
16.67 ms
p95 ?
17.48 ms
p99 ?
18.00 ms
Slowest ?
20.56 ms
Mean ?
16.71 ms
Standard deviation ?
0.44 ms
1% low ?
54 fps
0.1% low ?
49 fps
Hitches ?
0 of 600
Over budget ?
0 of 600

Main thread

Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 0.5 / 0.6 ms

Input

No input during this run. A browser-tab run plays none.

Memory

JavaScript heap ?
69.1 → 69.2 MB
Growth ?
+0.07 MB

What it needs

Renders with
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Hero and landing pages
  2. Splash and welcome screens
  3. Creative and playful apps
  4. Empty states and onboarding
  5. Celebrations after an action
  6. Interactive backgrounds behind cards

Pitfalls, in brief

  1. Put the canvas behind the page (position: absolute; inset: 0) with pointer-events: none, and give pointer the element the visitor actually presses on, or the pour never starts.
  2. Obstacles are in the canvas’s CSS px from its top left.
  3. watchObstacles re-reads on resizes, scrolls and style or class changes of the marked elements.
  4. A corner radius is read once per element and cached until the element resizes.
  5. At most 32 obstacles and 96 splats a step: more panels are left out, more splats wait for the next step (they keep it awake meanwhile).
4 more in brief
  1. It rests three seconds after the last stir and then draws nothing; the ambient jets keep it awake for as long as they are on, so leave them off where the page should go quiet.
  2. A new grid size (the Motion grid or Paint detail knob, or a canvas of another shape) rebuilds the grids: the colour is carried over, the motion is not.
  3. Without WebGPU it runs on WebGL2 (splash-gl.ts): the same grids, passes and look.
  4. Reduced motion slows the paint, softens bursts and turns the jets off; the pointer still pours, because the visitor asked for it.
9 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Adapted from published work, named below.

Pavel Dobryakov, WebGL Fluid Simulation (MIT): The mock-up’s simulation follows his: the same passes in the same order, the old pressure kept at 0.8 as a warm start, dissipation as 1 + rate × dt, reflected walls in the divergence, and his recommended rates (swirl 30, about 20 pressure passes, colour on a 1024 grid). Rewritten in WGSL compute; his licence is in NOTICE.md.

Jos Stam, Stable Fluids (SIGGRAPH 1999) and Real-Time Fluid Dynamics for Games (2003): The method: semi-Lagrangian advection and a pressure projection.

Ronald Fedkiw, Jos Stam and Henrik Wann Jensen, Visual Simulation of Smoke (SIGGRAPH 2001): Vorticity confinement, the Swirl knob.

Inigo Quilez, 2D distance functions and smooth minimum: sdRoundBox (every panel’s shape) and the polynomial smin that joins a membrane’s panels, re-written in WGSL.

Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering (2020): The PCG hash behind the paper’s grain, the powder and the noise.

Third-party terms ship with it in NOTICE.md.

fluidstable fluidscomputewgslraw webgpudom + gpuobstaclesrestingpaintbackgroundwebgl2 fallbackno dependencies

Near it in the frame