Metaball Lava Lamp

Simulates a classic wax lava lamp: warm buoyant "blobs" rise from a heated base, cool near the top, then sink back down, merging and splitting as they drift. Under the hood there is no actual mesh geometry for the wax — each blob is a sphere signed-distance-field (SDF) evaluated per-pixel by a raymarching fragment shader covering the full screen, and neighbouring spheres are fused together with a smooth-minimum (polynomial smin) blend so they ooze into and separate from one another organically instead of just intersecting like hard spheres. Blob motion (rise/sink direction, radius and horizontal wobble) is computed on the CPU each frame and streamed into the shader as uniform arrays; the glass cylinder around it is a real transmissive MeshPhysicalMaterial mesh rendered in a second pass on top.

Technique
Raymarched SDF
Blob count
8
Smooth-min k
0.45
March steps
96
Glass IOR
1.4