Demo hero, drawn under the goo

Pull it. Stretch it. Snap.

A mock landing page for testing the trail. The goo is a WebGL layer on top of all of this, yet it never takes a click, and it parts around the tip of your cursor.

Try clicking a button through the goo.

How it works

How it works

There is no fluid grid here. The goo is up to 128 beads on strands, simulated on the CPU, and every pixel of its surface is computed exactly from them, in one shader pass. Each link of a strand is an uneven capsule, bent into up to three on curves. All of them are joined with the exponential smooth-min, d = −k·log₂ Σ 2−dᵢ/k, which is a metaball field in log space. Since that union doesn’t care about order, beads can stretch apart, pinch off, fly away and melt back in without any bookkeeping in the renderer. The same sum gives the distance, its gradient and the local thickness, so the surface is lit like syrup sitting on the page.

Pipeline (per frame)

pointer (shell) ─▶ HEAD   damped spring ω = 6.5–17 rad/s, ζ = .8, settling 1.2 R behind the cursor tip
                          drops a bead every 0.5–1.3 R of arc: wider when fast, tighter on curves (κ);
                          fat when slow, thin again as the pointer comes to rest
 CPU, dt-based, no allocation
 ring buffer  128 beads × Float32Array: pos, vel, base radius, age, life, wave phase, seed, link → older bead
  ├─ physics ×2 substeps   tension-only link springs · bending · head drag · cohesion (≤ 8128 bead pairs,
  │                        skipping beads within 10 places along the trail) · gravity · viscous drag that
  │                        rises 2.5× over a bead's first second (laid goo sticks) · cursor push (slow pointer)
  ├─ links                 viscous creep: a stretch stays instead of springing back; stretch thins the beads
  │                        (r ∝ 1/√stretch); a link necks just before it snaps (2.4–4× its laid length);
  │                        a snapped neck retracts as two blunt cones (tip ≥ .35 r, .13–.26s)
  ├─ radius wave           r·(1 + a·sin φ), a grows from 1–1.5s of age → troughs pinch off → pearls;
  │                        a retracting thread feeds its volume to the goo it pulls into (r³)
  ├─ contract + merge      once beaded, pieces pull in; a free piece of ≤ 4 beads pulls in all the way and
  │                        its beads drain into one (r³): a drop; a thin loose end retracts into its neighbour
  ├─ remesh                links > 1.7 R get a Catmull-Rom midpoint bead
  ├─ droplets              flung sideways above a head speed; drain into goo they touch (volume ∝ r³)
  └─ segments              ≤ 392: links as 1–3 Hermite sub-capsules (≤ 10–20° of turn each, by k), free
                           beads, the head link → 3 × vec4 each (the third: the strand's tangent and radius
                           slope at both ends, shared with the neighbour), plus bound circles
 GPU   one program → canvas RGBA8 2560×1440, premultiplied, no render targets
  TILES ≈ 2.6 R (96–256 px): the CPU bins the segments whose bound reaches each tile, skips a tile when
        an upper bound on its weights (Σ 2^−D/k) puts every pixel beyond edge, halo and shadow, packs the
        lists into one uniform buffer (std140, aligned offsets), uploads it once and draws each tile
        scissored with bindBufferRange (measured 29–65 tile draws, ≤ 34 segments per tile on Slime)
  per pixel, per segment in the tile (cull 4.5k, at most 3.2 R; weight faded to 0 over its outer half):
        intact link ─ 1 uneven capsule (iq) │ necked or retracting ─ 2 capsules to the neck − their neck disc
        − its shared end disc (inclusion–exclusion: joints aren't counted twice), smooth-gated
        shading gradient: sides in the frame interpolated between the two ends' tangent + slope; caps and
        end discs radial, held at the joint's tube normal across the wedge between capsules
        accumulate Σw, Σw·∇d, Σw·ρ, Σw·age, Σw·seed and the largest single capsule weight
  d = −k·log₂Σ   ∇d = Σw∇d / Σw (clamped to |∇d| ≤ 1)   cursor tip: smooth subtraction, only while moving
  coverage      clamp(.5 − (d/|∇d|)/px)                        constant 1-px edge, any blend radius
  height        spherical cap over the local radius + k·log₂(Σw / max w) (contact slope 1.8·depth)
                → normal from ∇d, levelled where merged strands' gradients cancel
  colour        Beer–Lambert T = exp(−A·tint·(thickness + refract·(1 − n.z))), A = −ln(body)
                light page: page·τ + bg·(T − τ) + scatter + caustic, α = 1 − τ, τ = translucency·min(T)
                dark page: wrap-lit body + bounce rim; with glow: dark-rock albedo + emission by heat
                (churning yellow-orange core → orange → crust plates (cells) split by glowing cracks)
                + Fresnel environment + Blinn-Phong spot + softbox window (softer on molten goo)
                hue-preserving shoulder · ±½ LSB dither
  halo          dark pages with glow: compact (1 − d/2.5g)³ from the uncarved distance, × heat (no haze)
  shadow        light pages: the same field one offset away, d(p − off) ≈ d − ∇d·off: contact + cast,
                tinted, composited under the goo
  clear zone    a resting fine pointer fades the goo within 0.03–0.09 screen heights of its tip

The ideas that matter

Parameters

Presets

Performance & compatibility

References & credits