← Iris

heat 0.5
viscosity 0.50
blobs 8
blob size 1.0

Rayleigh–Bénard convection

The lava lamp is a convection cell. A heat source at the base warms wax that is slightly denser than the surrounding fluid at room temperature. As the wax heats, its density drops below the fluid’s, and buoyancy pushes it upward. At the top, away from the heat, the wax cools, contracts, becomes denser again, and sinks. This cycle is Rayleigh–Bénard convection — the same process that drives atmospheric weather cells, mantle convection in the Earth, and granulation on the surface of the Sun.

Metaballs and implicit surfaces

Each blob is a point with a radius and a field function: the influence at any pixel is the sum of r²/d² over all blobs, where d is the distance to the blob center. Pixels where this sum exceeds a threshold are “inside” the surface. Because the field is additive, two blobs close together merge smoothly into one continuous shape — and as they separate, the bridge between them thins and snaps. This is the metaball technique, introduced by Jim Blinn in 1982.

Why blobs split

As a rising blob stretches vertically, its surface area increases relative to its volume. Heat loss from the surface cools the extremities faster than the core. The ends contract while the middle is still buoyant, creating a neck that thins until surface tension can no longer hold it together. The blob pinches off into two. The reverse happens when blobs collide — surface tension pulls them together into a single lower-energy shape.