How it works

How it works

The cursor is a smouldering incense stick. It lays heat and smoke into a 2D fluid. Buoyancy lifts the warm thread, a cooling clock decides where the thread stops being laminar and starts to curl, and once it has cooled, drag slows it into hanging wisps. As the smoke ages it spreads wider and thinner. It is then lit as if it had depth: every pixel measures how much smoke lies between it and each lamp. That is why the ribbons have bright faces, shadowed undersides and folds that darken one another, instead of reading as a flat grey haze.

Pipeline (per frame, 2560×1440)

pointer path ─ shell segment (gaps under 0.4 s bridged) · fixed 60 Hz sim step (120 Hz frames reuse the last image)
  │
  ├─ STATE       gentle grip toward the stick's velocity · heat (saturating) + clock line-integral splat
  │              resting stick: lift, heat and clock eased toward a target in a small puff
  │              Boussinesq lift · drag on cooled air, more in the top fifth · Newtonian cooling
  │              curl noise on smoke (masked by the smoke's mip)
  │              state  RGBA16F 455×256   (vel.xy in texels/s, temperature T, laminar clock C)
  ├─ CURL        ω = ∂v/∂x − ∂u/∂y                                       R16F    455×256
  ├─ VORTICITY   confinement ε·(N × ω), weak while C is high, |v| clamp  RGBA16F 455×256
  ├─ VISCOSITY   Jacobi ×6 on (I − ν·dt·∇²)u = u₀                        state ping-pong
  ├─ DIVERGENCE  ½(∂u/∂x + ∂v/∂y), zero-gradient (open) edges            R16F    455×256
  ├─ PRESSURE    red-black SOR, ω = 1.8, 18 passes, warm start ×0.85,
  │              p = 0 outside the screen (smoke leaves freely)          R16F    ping-pong
  ├─ GRADIENT    u −= ½∇p
  ├─ SMOKE  A    forward trace by u + dye-only detail (curl-noise tex)   R16F    1820×1024
  ├─ SMOKE  B    MacCormack correction, eased off in sheared folds,
  │              clamped to the 4 source texels · age spread (mip tap)
  │              fade + bleed · line-integral deposit (tapers as the
  │              stick slows) · smoulder puff toward a target density    R16F    1820×1024
  ├─ MIPMAPS     generateMipmap on the smoke (shadow taps, spread, turbulence mask)
  ├─ ADVECT      semi-Lagrangian self-advection of the state, edge sponge
  │
  ├─ LIGHT       10-tap optical-depth march toward each of 2 lights,
  │              IGN-jittered, each tap blurred more with distance,
  │              blended 50/50 with last frame (fresh after a resize,
  │              an idle stop or for the still) · cast-shadow density
  │              of the smoke that survives the cut · blurred AO density RGBA16F 640×360 ping-pong
  └─ DISPLAY     tent upsample of the light · Beer–Lambert α, crisp cut on optical depth
                 light-wall contrast curve · clear zone above the pointer
                 near-field τ at full res · directional-derivative diffuse
                 multiple-scatter octave · forward-scatter rim
                 backdrop pools, vignette, cast shadow · linear → sRGB · triangular dither
                                                                         canvas  2560×1440

30 sim passes + 2 smoke passes + light + display = 34 draws and 1 mip build per frame
about 21 MB of render targets

The ideas that matter

Parameters

Presets

Performance & compatibility

3.8–5.3 msGPU per frame (mean) at 2560×1440
7.5–8.5 msGPU p95, same sweeps
≈0.1 msJavaScript per frame
60 fpsduring the scripted pointer sweep

References & credits