Home▸Optics & Light▸Underwater Caustics Simulator (2D)

Underwater Caustics Simulator (2D)

Interactive 2D underwater-caustics simulator: a wavy water surface built from several sine waves refracts overhead sunlight (Snell's law, n=1.333) into a shimmering, moving network of bright and dark caustic lines on the pool floor.

Optics & Light2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-3d-underwater-caustics ↗ Open standalone

This 2D top-down simulator ray-traces overhead sunlight through a physically modeled, ever-changing water surface — five superposed sine waves of different wavelength, direction and speed — refracting each ray at the air-water interface via Snell's law and following it down to a pool floor, where the accumulated density of ray landings paints the bright, shifting caustic network you'd see at the bottom of a real sunlit pool. Drag the amplitude slider to sharpen or soften the focusing, the speed slider to slow the pattern down to a near-still frame or set it rippling, and the depth slider to watch the same surface slopes paint a tight or a diffuse caustic net depending on how far the rays travel before they land.

⚙ Under the hood

A 2D top-down companion to the 3D underwater-caustics scene: thousands of parallel light rays are refracted through a five-wave water surface via Snell's law each frame and accumulated onto a floor grid, so the bright caustic network is a real ray-density map that sharpens, blurs and drifts as the amplitude, speed and depth sliders change.

causticsrefractionSnell's lawray tracingunderwater opticswave focusing

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)