Thin-film optics & soap chemistry
A soap bubble is a sheet of clear soapy water thinner than a wavelength of red light. Its swirling rainbow skin comes entirely from wave interference between two reflections — and changes moment by moment as gravity and evaporation thin the film.
On this page
Interactive 64-band Airy interference bench
Soap film slab & Snell refraction
At d → 0, the λ/2 front phase flip cancels all colours into Newton black.
Reflectance R(λ) · 64 bands (380–740 nm)
What a bubble really is
A bubble is a liquid film, usually between 25 and 1,200 nanometres thick — thinner than a thousandth of a millimetre — wrapped around a pocket of gas. The sheet has two free interfaces, inside and outside, each lined with surfactant molecules whose water-loving heads anchor in the water while their oily tails point outward into air.
In Ooh Bubbles, the default recipe is a clean laboratory reference: a dilute solution of SDS (sodium dodecyl sulfate, ~10 mM) in pure water, initialised around 380 nm thick so freshly blown bubbles immediately show rich first- and second-order interference ribbons.
Why bubbles shimmer with colour
Soapy water has no pigment. When light strikes a film, a small fraction reflects from the outer air-to-water boundary (picking up a half-wavelength phase flip) and a second fraction refracts through the water, bounces off the inner water-to-air surface, and exits beside the first ray. Depending on the film thickness d and viewing angle θ, some wavelengths align and brighten while others cancel out.
Ooh Bubbles computes thin-film colour properly rather than faking it with rainbow textures: it splits visible light into 64 spectral bands from violet to deep red, evaluates Fresnel and Airy multiple-bounce reflectance at every film thickness and viewing angle (including Cauchy dispersion shifted via Lorentz–Lorenz water–glycerol mixing [42] so blue bends slightly more than red and glycerol-rich films gleam brighter), and converts the spectrum to display colour through the analytic CIE 1931 colour-matching functions of Wyman, Sloan and Shirley [1].
δ(λ) = 4π · n(λ) · d · cos θt / λ
R(λ) = 4 r2 sin2(δ/2) / [ (1 − r2)2 + 4 r2 sin2(δ/2) ]
Where n(λ) is the dispersive refractive index of the aqueous soap–glycerol film, d is local film thickness, θt is the internal refracted angle from Snell’s law, and r is the single-interface Fresnel amplitude reflectance (averaged over s and p polarisations). On desktop, nearer overlapping bubbles also attenuate distant films along each view ray.
Draining, evaporation & colour ageing
The moment a bubble forms, gravity starts pulling water downward through the film. The apex grows thinner and shifts toward first-order gold, pale silver, and eventually transparent Newton black, while the bottom collects a thicker, heavier drop. At the same time, water evaporates into the surrounding air at a rate set by the room’s relative humidity.
The simulation evolves each bubble’s mean thickness with the thinning law measured on real bubbles by Lhuissier and Villermaux [2], drains the top faster with vertical film drainage, couples ideal-gas thermal/pressure expansion into strictly mass-conserving shell thickness (h ∝ 1 / R2), and adds humidity-dependent evaporation grounded in Miguet et al. [3]. Drained water gathers into a tiny drop at the bubble’s bottom pole while rising buoyant thin-patch plumes (a tuned marginal-regeneration closure) carry iridescent swirls upward from the lower meniscus, slowed by glycerol viscosity and locked solid as crystalline ice rigidity grows.
Vertical drainage across a bubble’s life
1. Fresh (~380 nm)
2nd-order vivid colour bands across the shell.
2. Ageing (100–250 nm)
Gravity drains liquid downward into a heavier bottom drop.
3. Apex ≈ 25 nm
Newton black cap reaches ~25 nm → spontaneous pop.
Soap chemistry: SDS & glycerol
Surface tension sets nearly everything a bubble does: how round it pulls itself, how fast it wobbles, and how fast its rim zips back when popped. More surfactant molecules packed onto the water surface lower the surface tension; the simulation uses measured SDS interfacial data from Weißenborn and Braunschweig [7] and dilute SDS viscosity measurements from Kushner et al. [15].
Adding glycerol increases the liquid’s viscosity, density, and refractive index, dramatically slowing drainage so giant bubbles last longer, brightening Fresnel reflections (e.g. raising n589 from 1.333 to ~1.373 in Giant Glycerin for ~20% stronger normal-incidence gleam), and depressing the freezing point in Frozen mode. The engine implements measured aqueous-glycerol density (Volk & Kähler [13]), viscosity (Cheng [14]), and Lorentz–Lorenz refractive dispersion matched to Hoyt’s refractometry tables [42] across the player’s soap formulations:
| Soap formulation | Composition | Physical effect on screen |
|---|---|---|
| Classic (default) | Dilute SDS in pure water (0% glycerol) | Balanced surface tension, lively Lamb wobble, crisp 2nd-order shimmer, ~90 s lifetime at 50% RH. |
| Glycerin | SDS + aqueous glycerol polymer mix | Higher liquid viscosity and refractive index slow gravity drainage into silky plumes, gleam brighter, last longer, and lower the freezing point. |
| Fragile | Thinner initial film tuned near rupture | Fast Taylor–Culick rim speeds and vivid high-contrast first-order colours primed for domino pop cascades. |