← Lab

Free Water

Ray-marched SDF, Rayleigh modes, Fresnel, Beer-Lambert, HDRI

The shape is not animated by hand. Rayleigh worked out in 1879 that a drop held only by surface tension can wobble in a fixed set of modes, and how fast each one rings: the square root of surface tension over density times the cube of the radius. This drop is six centimetres across, so it swings between egg and pancake once every four seconds and its three lobed mode about twice as fast, which is what the same drop does on the space station. Each mode is kept as a tensor rather than an axis and an amplitude, so pokes from different directions add up instead of replacing each other. Run the pointer across it and it sways; tap it and a capillary ripple runs out from the point of contact at the speed the dispersion relation gives it, thins as its ring widens, gathers again as it closes on the far side, and comes back. It is a wave a quarter of a millimetre high, and it shows up only because it tilts the reflections. The light is traced rather than faked: Fresnel at the first surface, Snell's law into the water, a march to the far side, then part of it out and part reflected back in to try the next face, with total internal reflection when Snell has no answer. The path length feeds Beer-Lambert with Pope and Fry's measured absorption for pure water, and red, green and blue are traced as three separate rays with water's real dispersion, parting company at the first surface, which is where the thin fringe on the rim comes from. The world it sits in is a photograph. Click the world rather than the drop and it becomes another one: a country road, the Shanghai waterfront at night, a photo studio, a desert at dawn, all Poly Haven HDRIs kept in high dynamic range by storing the log of the light in an ordinary WebP, so the sun still glints on the surface and the city lights bloom. The camera is treated as a camera too: the road behind is out of focus because the lens is on the drop, and the glint blooms because that is what glass in front of a sensor does.