1,048,576 particles · 1024×1024 RGBA32F

How it works

How it works

This page is moving 1,048,576 particles right now (a 1024×1024 RGBA32F texture), every one of them every frame. They ride a current that is the curl of a single scalar stream function, so the flow can neither compress nor tear them: they stay evenly spread and draw unbroken threads, the way silk does in deep water. Your cursor stirs a small viscous fluid of its own. It drags the water along its path into a jet, the jet's ends curl into a pair of big, slow counter-rotating eddies, and luminous threads are born along the stroke, so the path you drew glows and keeps coasting for a few seconds after you stop.

Pipeline (per frame)

per frame · 2560×1440 canvas · 1,048,576 particles (desktop tier)
JS  hand velocity V = pointer travel ÷ time between events (80 ms attack, 90 ms release)
    drag target u = grip·V, capped at grip·0.9 screen-h/s · this frame's capsule a→b
    emitter: 655 luminous ids per screen-h of travel (≤ 8,192 per wake life) → ring head
    α[o] = phase·(1, 1.7, 2.4, 3.1) mod 2π      noise shift mod 289 (the hash period)
 │
[W] WAKE FLUID 82×48, vorticity / stream function                           3 passes
    W1 ω, dye  RG16F   advect by last frame's v · blur of variance 2ν·dt (ν = R²/2)
                       · e^(−dt/linger) · grip mix in the capsule:
                       ω += k·(∇W × (u − v) − W·ω)        W = e^(−d²/R²)
    W2 ψ       R32F    2 red–black SOR iterations on ∇²ψ = −ω (warm-started),
                       one pass each: a black cell recomputes its red neighbours
    v_wake     no pass (∂ψ/∂y, −∂ψ/∂x) by central differences, read from ψ by W1, F
 │
[F] FIELD      437×256 RGBA16F, LINEAR                                     1 pass
    ψnoise = Σo a·gainᵒ/2ᵒ · psrdnoise(2ᵒ·x/L + shift, αo)    analytic ∇ per octave
    ψ = ψc + A·(ψnoise − ψc)      A = 1 − e^(−r²/R²): a resting hand is a calm
    out  v = (∂ψ/∂y, −∂ψ/∂x) + v_wake · calm = 1 − smoothstep(t0, t1, |octave 0|) · dye
 │
[U] UPDATE     1024×1024 MRT, NEAREST, texelFetch                          1 pass
    out 0  RGBA32F  x, y, streak start 2×12 bit, age 16 bit · life 8 bit
    out 1  RGBA16F  vx, vy, –, wake-born
    v ← mix(F(p + ½dt·v), v, e^(−dt/0.35 s))      p += dt·(v_old + v)/2
    ids in the ring's window this frame: reborn in the hand capsule
    others: respawn on death or exit (0.05 margin); below the luminous rows
            each 8×8 texel block respawns in its own box of a 128×127 grid
 │
[A] ACCUMULATE 1690×950 RGBA16F (0.66 × backing)                           1 pass
    A1 fade     blend ZERO·CONSTANT_ALPHA        dst ×= 0.01^(dt/T)
    A2 threads  instanced quads (4 vertices): 8,192 luminous ids every frame
                (70% of the light), satin sheen in 5 phases → 216k per frame
                quad laid along streak start → now; smoothstep pair along, gaussian
                across, tapered toward its start by fade^k (k frames since drawn)
                light/length ∝ (1 − fade)·area/(N·2.2σ·U) · class · calm · sheen
                · speed^1.2 with a knee at 2.5× (wake-born: 1.8 · speed^−½ when fast)
 │
[B] BLOOM      422×237 → 52×29 RGBA16F, 3 dual-Kawase downs, 3 ups          7 passes
               4×4 box first, with a soft-knee threshold (only light above 0.6 blooms)
 │
[C] COMPOSITE  canvas 2560×1440, opaque                                    1 pass
    dark   bg + (1 − bg)·shoulder(acc + bloom)   hue-preserving ⊕ per-channel,
           then the brightest accumulated light heats toward the palette's white-hot,
           vignette, and a cut of residue below ½–2 LSB of the output
    light  paper · e^−ink · relief gated by ink density (grazing light, glint)
           · e^−(1/8-res blurred ink, 11 CSS px down-right)    Beer–Lambert + cast shadow
    ±½ LSB interleaved-gradient-noise dither

The ideas that matter

Parameters

Presets

Performance & compatibility

References & credits