Demo hero, drawn under the fire

Leave a trail of fire.

A mock landing page for testing the effect. Your cursor lays a line of fuel that catches a beat behind it, licks upward, cools into smoke and throws embers, yet the flames never take a click.

How it works

How it works

A real combustion simulation runs behind the page: a 455×256 stable-fluids grid carries velocity, temperature and fuel, and the colour you see is the physical blackbody colour of that temperature. Your cursor does not paint fire. It lays a line of fuel on the “ground”, and an igniter that follows your path 0.14 s late sets it alight. The flames grow in your wake and keep burning where you drew for four to five seconds, while the fuel right under a resting pointer waits to catch until you move on.

Pipeline (per frame)

pointer path ring buffer {x, y, t}  ─┬─ capsule prev→now          (fuel, grip)
                                     └─ capsule at path(t − 0.14 s) (igniter)
live user pointer ──▶ mask m = 0 within ~1 brush radius, 1 beyond 1.6 (none for the ghost torch)
fixed 60 Hz sim step, run once ≥ half a step has built up (1 per frame at 60 Hz, 0–2 otherwise)
│
├─▶ TORCH, BED   state RGBA16F  455×256  v ← mix(v, v_ptr, w·grip); T ← max(T, (2·T_ign+.6)·w·m) on fuel
│   + COMBUST    bed   RGBA32F  455×256  static fuel line, never advected: B += w·deposit·s
│   one MRT pass rel   R16F     455×256  lit = max(lit, m·ign(T)); masked hits wait in a pending latch
│                                        release = k·(B/s)^⅛·lit·m·jets(noise), also into rel
│                                        s = burn time / 4.2, so a longer burn lays more fuel
│                                        T, F −= ¼·[1 −4 6 −4 1]/16 in x and y (kills the odd-even mode)
│                                        F += release·dt; burn = min(F, F·ign(T)·rate·dt)
│                                        T += burn·heat;  T ← T / (1 + (c·T^3/8 + m)·dt)
│                                        v.y += b·T·dt;   v += curl-noise·dt in hot gas; drag, |v| clamp
├─▶ VORTICITY    state                   ω = ∂v/∂x − ∂u/∂y at 9 texels; v += ε·(N × ω)·dt, N over 1.5 texels
├─▶ PRESSURE ×4  pres  RG32F    455×256  14 Jacobi sweeps as 2 + 4 + 4 + 4, each pass over a diamond of
│                                        texels; the first computes div into .y: MAC faces (u left,
│                                        v bottom), forward differences, − e·burn; warm start 0.85·p
│                                        walls left/right/bottom; p = 0 in the top ghost row (open top)
│                + state (last pass)     v ← mix(v, 4-neighbour mean, .18) − backward-difference ∇p
├─▶ SOOT         soot  R16F    1280×720  clamped MacCormack by the MAC v, one pass; S += yield·burn·dt
└─▶ STATE        state                   MacCormack for T and F; semi-Lagrangian v, per face
    + EMBERS     MRT, sim-sized          4096 embers in the top-left 64×64 block of
                                         RGBA32F (pos, vel) + RGBA16F (life, max life, temp, seed)
┌────────────── render, every display frame, at t_sim + unstepped remainder ──────────────┐
│ SCENE      RGBA16F 2560×1440: noise-warped T; colour from a 5-tap Catmull-Rom, edge     │
│            from a B-spline through a narrow cut, ridged filaments in the hot cores      │
│            → blackbody LUT 256×1 (+ the gas cone from rel), then 4096 instanced         │
│            ember streaks (ONE, ONE), carried along their velocity to display time       │
│ PRE        13-tap Karis + soft knee → L0 1280×720 RGBA16F                               │
│            + MRT RG16F 1280×720: the soot's 5-tap blur and T, for the composite         │
│ DOWN       13-tap → L1 640×360                                                          │
│ TAIL ×2    L2 = 13-tap of L1; L3–L5 (160×90 … 40×22) as separable Gaussians of L1,     │
│            horizontal into strips, then vertical into one atlas                         │
│ GATHER     L1 + .85·tent(L2) + .85²·B(L3) + .85³·B(L4) + .85⁴·B(L5) → 640×360           │
│ COMPOSITE  canvas RGBA8: bloom = L0 + .85·tent(GATHER), normalised; flames·(1 − veil)   │
│            + bloom + fire-lit smoke → ACES → sRGB → TPDF dither                         │
│            premultiplied α = 1 − (1 − 0.4·smoke)·(1 − max); smoke × ¼ over the buttons; │
│            UI veil (floor 0.35) only around a real pointer over a button or link        │
└─────────────────────────────────────────────────────────────────────────────────────────┘
15 render passes per frame: 8 for a sim step, 7 for rendering (the ember draw shares the scene's)

The ideas that matter

Parameters

Presets

All four presets are dark. Fire is emission: additive light reads against a dark page and vanishes on white, where flames look like orange stickers. The light-page story for fire is a different model, burning paper with a char front and an ember rim (the burning-paper candidate in the research notes).

Performance & compatibility

References & credits