How it works

How it works

Ink is a little heavier than water, and that is almost the whole page. A Navier–Stokes solver carries the ink’s weight in a spare channel of its velocity texture and pulls down wherever there is ink. Nothing here draws a mushroom or a finger. The caps that roll up into twin lobes, the stems they trail, and the fingers that keep splitting off them all come out of gravity plus the pressure projection: Rayleigh–Taylor instability, solved on a 455×256 grid. The colour stores pigment concentrations, not colours, and the display turns them into light with Beer–Lambert absorption. That gives pale veils, near-black cores and true subtractive mixing for free.

Pipeline (per frame)

pointer segment (shell capsule) · click = drop    sim 455×256 · dye 1820×1024 · canvas 2560×1440
 │
 ├─▶ SPLAT sim    vel   RGBA16F  455×256    xy → mix(v, v_ptr, 1−(1−w′·stir)^(60Δt)),
 │                                          |v_ptr| ≤ 1.6 h/s,  w′ = w (drops) or exp(−d²/(1.5r)²)
 │                                          z (mass) += 1.6·ink·w·k     w = exp(−(d²/r²)²)
 │                                          k = 1 ± noise at 9.6/5.4 cells (pours 13/7.5)
 ├─▶ SPLAT dye    dye   RGBA16F 1820×1024   drops add, pours blend MAX, scissored to the capsule
 │                                          cᵢ = inkᵢ·edge(d/r)·lumps; 2.5-texel edge, warped
 ├─▶ CURL         curl  R32F     455×256    ω = ∂v/∂x − ∂u/∂y
 ├─▶ FORCES       v₀    RGBA16F             v += ε(N×ω)Δt (confinement)   v.y −= g′·m·Δt (buoyancy)
 ├─▶ VISCOUS ×8   vel                       Jacobi on (I − νΔt∇²)v = v₀ for xy; mass passes through
 ├─▶ DIVERGENCE   div   R32F                mirror v at the walls · floor: zero-gradient outflow
 ├─▶ PRESSURE ×24 pres  R32F ping-pong      red-black SOR, ω = 1.8, first pass warm-starts ×0.85,
 │                                          Neumann at the walls, p = 0 below the floor
 ├─▶ GRADIENT     vel                       v −= ½(R−L, T−B)   (the consistent factor)
 ├─▶ ADVECT dye   hat   RGBA16F 1820×1024   forward semi-Lagrangian, by the projected velocity
 ├─▶ MACCORMACK   dye                       step back, correct by 0.92·½·error, clamp to 4 source
 │                                          texels, ÷(1 + fade·Δt), −0.006·Δt bleed, floor sponge
 ├─▶ ADVECT vel   vhat  RGBA16F  455×256    forward semi-Lagrangian of (v, m)
 └─▶ MACCORMACK   vel                       v: plain result ÷(1 + 0.3·Δt); m: clamped correction
                                            ÷(1 + 0.6·fade·Δt), floor sponge
 ┌──────────────────────────────── display, every frame ────────────────────────────────┐
 │ SOFT     dye → ¼-res 4×4 box → H + V 5-tap Gaussian            RGBA16F 455×256       │
 │ DISPLAY  → canvas, opaque RGBA8                                                      │
 │   c += e·(1.6 + 2.4e²)·max(c − soft, 0)    pigment gathers at the rims (e = edges)   │
 │   c ×= granulation(tooth) · smoothstep(cut, 4·cut, c) ;  c ← c^contrast              │
 │   ink:   paper(tooth, fibres, mottling) · exp(−0.45·depth·Σ softᵢ(uv + off)·σᵢ)      │
 │                                         · exp(−Σ cᵢ·σᵢ)          all in linear light │
 │   glow:  min(water, 1)·e^(−0.7Σc) + (1 − e^(−1.35E)) + hot core + 0.45·depth·halo    │
 │   → sRGB, ±1 LSB triangular dither                                                   │
 └──────────────────────────────────────────────────────────────────────────────────────┘
 PAPER (once at load)  1024² RGBA8, REPEAT + mipmaps: lit tooth · tooth height · mottling · fibres
 PRE-ROLL (first frame only)  96 steps: 3 drops + the first 1.4 s of the ghost pour
 44 draws per frame, +2 per pour segment, +2 per drop

The ideas that matter

Parameters

Presets

Performance & compatibility

References & credits