How it works

How it works

Nothing here is a mesh or a sprite. Three to twelve droplets (seven by default) are spheres and teardrop-shaped round cones, written as signed distance functions and merged with a smooth minimum, so where two of them come close a liquid neck grows between them, and it tears when they part. Every pixel fires a ray into that field and sphere-traces to the surface. It is then lit by a procedural photo studio, as a mirror, an interference film or a lens of glass. The motion comes from a few springs on the CPU: a heavy body that only leans toward your cursor, light droplets that gather just short of the pointer, and the lightest two or three, which run along the path your cursor just took, so a fast stroke pulls a string of beads out of the pool that necks off and falls back in.

Pipeline (per frame)

CPU   pointer → presence (eases in within ~0.2 s, out from 2.2 s after the last move)
      12 blobs: spring toward mix(home, target, pull × attraction), ω = speed/√r, ζ = damping
                target: an arc 1.35r + k past the tip, on the pool's side, behind the motion
                the 2–3 lightest: the pointer's path 80 / 160 / 240 ms back (ring of 64 samples)
                  + that point's velocity × the spring lag 2ζ/ω, full pull, ω × 2.2
                + clear zone round the tip (target and force) + soft contact (repel < 0.9·(rᵢ+rⱼ),
                cohesion just outside; softer for the beads) · click = radial splash
                · speed capped at 16 units/s by magnitude · 240 Hz substeps
                tail point on its own critically damped spring (ω 13) → round cone, length eased
                into 1.15r, tail radius → 0.3 head, head radius solved for equal volume
      upload: head (xyz, r), tail (xyz, r), bound sphere ×12 · shadow capsules ×12 (light theme)
 │
 ├─▶ MARCH      low    RGBA16F  1408×792 (scale 0.55 of 2560×1440)      premultiplied, tone-mapped
 │      per ray: cull 12 bound spheres → mask (r + max(6k, .55·size)) + interval (r + 3.2k)
 │               sphere trace ≤ 72 steps over cubic smin of the masked blobs; miss → closest
 │               approach → coverage (silhouette AA); a near miss passed before the hit → inner
 │               silhouette: shaded at both points, blended by its coverage
 │               · tetrahedral normal (4 map) · |fwidth(R)| → env prefilter width
 │      studio       ground + floor glow · sky · horizon line · 5 softboxes, each integrated over
 │                   the prefilter width (box ⊗ box per axis, so sub-pixel strips dim, not dot)
 │      chrome/gold  AO (4 map) · reflect → cull + cone trace ≤ 30 steps without the primitive
 │                   we're on; near a seam traced twice, once without each of the two nearest,
 │                   blended 50/50 on the seam · fades out where R turns > 0.2–0.6 rad/pixel
 │                   → studio(R) or the neighbour's mirrored studio, prefiltered by its spread · F0
 │      film         same bounce × film LUT(2·n·d·cosθt) over a pearly, part-transparent body
 │      glass        refract in → trace −map inside ≤ 40 steps → exit normal → per wavelength (6,
 │                   IOR ± dispersion) Schlick at the exit: (1−F)·refracted + F·inner reflection
 │                   · key light ×0.4 through the lens · Beer–Lambert · backlit strips to refract
 │                   · where |fwidth(exit)| > 0.15–0.4: a blurred lookup along it · Fresnel mix
 ├─▶ BRIGHT     b1     RGBA16F   704×396   4-tap box, soft knee on the brightest channel   (dark)
 ├─▶ DOWN ×2    b2, b3 RGBA16F   352×198, 176×99    dual filter                            (dark)
 ├─▶ UP ×2      u2, u1 RGBA16F   352×198, 704×396                                          (dark)
 ├─▶ SHADOW     RGBA8            640×360   smooth union of 12 projected capsules          (light)
 └─▶ COMPOSITE  canvas           2560×1440 backdrop (+ glass backlight) · cast shadow
                                           · Catmull-Rom 5 taps (1 tap where the 2×2 is empty)
                                           · bloom as a screen blend · sRGB · dither
 once at load: shaders built in parallel (KHR_parallel_shader_compile, polled; the stage shows
               its CSS background meanwhile) · thin-film LUT 512×1 RGBA8 (CIE-integrated)
               · dispersion weights (6 wavelengths, 3 on phones)
 every 30 frames: GPU time, or frame intervals where there is no GPU timer → adaptive march scale
 phones: ≤ 40 steps, no bounce, 3 dispersion taps, march scale × 0.85
 7 draws per frame on dark presets, 3 on light ones

The ideas that matter

Parameters

Presets

Performance & compatibility

References & credits