Light focused by a moving lens
Caustics are the bright, shifting web of light patterns you see on a pool floor on a sunny day. They form because a wavy water surface isn't flat glass — it's a constantly-changing lens. Every patch of the surface has some local slope, and Snell's law governs how a ray bends as it crosses from air (refractive index n₁ ≈ 1.0) into water (n₂ ≈ 1.333): n₁ sin(θ₁) = n₂ sin(θ₂). A patch of surface tilted one way focuses nearby rays together into a bright band; a patch tilted the other way spreads rays apart into a dim region. Because the surface is never flat for more than a fraction of a second, the focused bright bands sweep and shimmer continuously across the floor.
// Snell's law at an air-water interface n1 * sin(theta1) = n2 * sin(theta2) n1 = 1.000 (air) n2 = 1.333 (water) theta2 = asin( (n1 / n2) * sin(theta1) ) // bend TOWARD the normal, entering denser medium
Why caustics concentrate, not spread, light
A flat interface refracts every ray by the same angle everywhere, so parallel rays stay parallel and the floor is lit evenly. A curved interface — and a wavy water surface is locally curved everywhere — refracts nearby rays by slightly different angles, because the surface normal itself is changing from point to point. Where the surface curvature happens to bend a bundle of nearby rays toward a common point, their light energy concentrates into a small area and that area is far brighter than the average illumination — that bright concentration is the caustic. Where the curvature spreads rays apart, the floor is correspondingly dimmer than average. Total light energy is conserved (refraction doesn't create photons); caustics are what happens when a lens redistributes that energy unevenly rather than spreading it uniformly.
Simulating it as a height field
A practical real-time approximation models the water surface as a height field, usually a sum of a few sine or Gerstner waves with different amplitudes, frequencies, speeds and directions to avoid an obviously repeating pattern. The surface normal at each point is the gradient of that height field, and it's the normal — not the height itself — that determines how light bends there, since Snell's law operates on the angle between the incoming ray and the local normal, not on elevation.
height(x, z, t) = sum(amplitude_i * sin(freq_i * (x*dir_i.x + z*dir_i.y) + speed_i * t)) normal(x, z, t) = normalize(-dHeight/dx, 1, -dHeight/dz) // gradient gives the tilt // refract each vertical light ray at the surface using normal + Snell's law, // then trace it down to the pool floor and accumulate ray density per floor cell
The forward-mapping trick
The efficient real-time technique — used in countless GPU water shaders — doesn't trace rays backward from the camera or the floor. Instead it works forward: for every point on the water surface, refract a hypothetical vertical ray of sunlight downward through that point using Snell's law, project it down to the floor plane, and accumulate a small amount of brightness at the floor pixel it lands on. Where many surface points' refracted rays converge onto nearby floor pixels — exactly where the surface curvature is focusing light — that floor region accumulates disproportionately more brightness, and the caustic pattern emerges directly from the density of ray landings rather than from any explicit focal-point calculation.
Depth, wave amplitude and pattern scale
Two parameters dominate how the resulting pattern looks. Water depth sets how much a given amount of surface tilt gets amplified by the time rays reach the floor — shallow water produces tight, sharp, high-contrast caustic filaments because rays haven't diverged much before hitting bottom, while deep water spreads the same refracted rays over a wider floor area, producing broader, softer, lower-contrast patterns. Wave amplitude and frequency set the scale and sharpness of the lens itself: small, high-frequency ripples (wind-chop) produce fine, fast-shimmering caustic filaments, while large, low-frequency swells produce slow-moving, broad bands of light. Both effects are why a pool's caustics look completely different on a calm morning versus a breezy afternoon, and why deep-end and shallow-end caustics in the same pool, under the same wind, never look alike.
Frequently asked questions
Why do caustics only appear as bright lines and bands, not evenly cover the floor?
A flat surface would refract all parallel light rays by the same angle, lighting the floor evenly. A wavy surface is locally curved, so nearby rays bend by slightly different amounts and get focused together in some places (bright caustic bands) and spread apart in others (dimmer regions) — the pattern comes from redistributing light unevenly, not from creating extra light.
What role does Snell's law play in caustics?
Snell's law, n1 sin(theta1) = n2 sin(theta2), determines exactly how much each ray bends as it crosses from air into water, based on the local angle between the ray and the water surface's normal at that point. Since the surface normal varies continuously across a wavy surface, so does the bend angle, and that variation is what focuses or spreads light into the caustic pattern.
Why do caustics look sharper in shallow water than deep water?
In shallow water, refracted rays haven't traveled far before hitting the floor, so the focusing effect from surface curvature stays tight and produces sharp, high-contrast filaments. In deep water, the same refracted rays diverge over a longer path before reaching the floor, spreading the focused light over a wider area and producing softer, lower-contrast patterns.
Try it live
Everything above runs in your browser — open Water Caustics and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Water Caustics simulation