---
id: "water-caustics-realtime"
title: "Real-time Water Caustics"
aliases: [image-space caustics, caustic mapping]
domain: "volumes"
stage: "volume"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, mobile-gpu]
year_introduced: 2006
inputs: [normals, heightfield, depth]
outputs: [texture, irradiance-probes]
style: "both"
dynamic: "dynamic"
cost: "medium"
authority: "Wyman & Davis, 2006"
url: "https://texelatlas.vercel.app/t/water-caustics-realtime/"
sources_verified_at: "2026-11-29"
---
# Real-time Water Caustics (Wyman & Davis, 2006)

> Approximate the bright, moving light patterns on a pool floor by refracting light through the water surface and splatting where each ray lands, or by scattering and tracing a cheap procedural pattern.

## Reach for it when

- pool floor lacks dancing light patterns
- underwater scenes need moving bright ripples
- need cheap plausible caustics for water
- light through waves should focus on seabed

## How it works

Render the water surface from the light's point of view as a normal map and refract the light direction at each texel (Snell's law). Each refracted ray is intersected with the receiving geometry, either by marching a depth/height texture of the floor, or analytically for a flat floor. Rays are splatted as small additive quads or points into a caustic texture; where rays converge the sum gets brighter, and the texture is then projected onto the scene. A cheaper version, popular in WebGL demos, compares the area of each refracted cell before and after refraction using screen-space derivatives of the refracted position, which gives intensity as the ratio of areas and avoids splatting. Temporal blur and a small blur kernel suppress noise. The caustic texture is multiplied into the lighting of floors, hulls and shadowed regions.

## When to use it

Choose it for pools, shallow seas and fountains when you can trade accuracy for a plausible, animated light pattern at low cost.

Prefer procedural approximations in the material (e.g. layered Voronoi noise) when the surface is not simulated and only the visual matters. Prefer path tracing with photon mapping offline for exact results. Use alongside [FFT Ocean (Tessendorf)](https://texelatlas.vercel.app/t/fft-ocean.md), [Gerstner (Trochoidal) Waves](https://texelatlas.vercel.app/t/gerstner-waves.md) or [Shallow Water Equations (Height-field Water)](https://texelatlas.vercel.app/t/shallow-water-equations.md) as the source of surface normals.

## Cost

medium — Splatting costs rise with surface resolution and overdraw; derivative-based methods are cheap.
Measured GPU Weight: 9.32× baseline (moderate) — 0.3065 ms median / 0.3274 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 7.96× baseline (moderate) — 0.1266 ms median (2.42× faster on L4).
Ampere A100 scaling: 5.26× baseline (light) — 0.1516 ms median (2.02× faster on A100).

## Failure modes

- Noisy, speckled caustics when splat density is too low
- Missing caustics shadowing: objects in the water do not occlude the caustic light unless added
- Wrong pattern focus depth if the floor distance used is a constant and the real floor is deep or sloped
- Flicker as the surface moves because caustic intensity is computed per frame without temporal filtering
- Only the first refraction is handled: reflective caustics and caustics from submerged objects are missing

## Engine support

- threejs: official — `examples/webgpu_caustics.html` (evidence: https://github.com/mrdoob/three.js/blob/r187/examples/webgpu_caustics.html, checked 2026-12-01) — Official example, not a setting.
- unity: builtin — `Water Surface > Caustics` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.render-pipelines.high-definition/Documentation~/water-caustics-in-the-water-system.md, checked 2026-12-01) — HDRP only.

## Dataflow

- Inputs: normals, heightfield, depth
- Outputs: texture, irradiance-probes
- Platforms: webgl2, webgpu, desktop-gpu, mobile-gpu

## Presets

### Analytic refraction caustics on a pool floor from an animated wave field (glsl-fragment; rendered 2026-11-29)

```json
{
  "DEPTH": 2,
  "AMP": 0.05
}
```

```glsl
// Analytic water caustics on a pool floor. Rays refract through an animated wave height field
// (Snell, eta=1/1.33); the floor point P is mapped back to its surface source by fixed-point iteration, and
// intensity = 1 / |det(d landing / d surface)|: focusing where neighbouring rays converge.
const float DEPTH = 2.0;
const float AMP = 0.05;

vec2 slope(vec2 p) {
  vec2 g = vec2(0.0);
  g += AMP * 6.0 * cos(dot(vec2(0.8, 0.6), p) * 6.0 + iTime * 1.3) * vec2(0.8, 0.6);
  g += AMP * 8.0 * cos(dot(vec2(-0.5, 0.86), p) * 8.0 - iTime * 1.7) * vec2(-0.5, 0.86);
  g += AMP * 11.0 * cos(dot(vec2(0.2, -0.98), p) * 11.0 + iTime * 2.1) * vec2(0.2, -0.98);
  g += AMP * 14.0 * 0.6 * cos(dot(vec2(-0.9, -0.43), p) * 14.0 - iTime * 2.6) * vec2(-0.9, -0.43);
  return g;
}
vec2 land(vec2 p) {
  vec2 g = slope(p);
  vec3 d = refract(vec3(0.0, -1.0, 0.0), normalize(vec3(-g.x, 1.0, -g.y)), 1.0 / 1.33);
  return p + d.xz / (-d.y) * DEPTH;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  vec2 P = uv * 3.0;
  vec2 x = P;
  for (int i = 0; i < 4; i++) x = P - (land(x) - x);
  float e = 0.004;
  vec2 fx = (land(x + vec2(e, 0.0)) - land(x - vec2(e, 0.0))) / (2.0 * e);
  vec2 fy = (land(x + vec2(0.0, e)) - land(x - vec2(0.0, e))) / (2.0 * e);
  float I = clamp(1.0 / max(abs(fx.x * fy.y - fx.y * fy.x), 0.12), 0.0, 6.0);
  vec2 tile = fract(P * 0.8);
  vec3 floorc = mix(vec3(0.08, 0.3, 0.38), vec3(0.1, 0.38, 0.45), step(0.5, fract(floor(P.x * 0.8) * 0.5 + floor(P.y * 0.8) * 0.5) * 2.0));
  if (min(tile.x, tile.y) < 0.03) floorc *= 0.6;
  vec3 col = floorc * (0.25 + 0.55 * I) + vec3(0.6, 0.95, 1.0) * pow(I / 6.0, 2.0) * 1.5;
  col = col / (1.0 + 0.5 * col);
  fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);
}

```

Attribution: written for this index

## Combines with

- [Shallow Water Equations (Height-field Water)](https://texelatlas.vercel.app/t/shallow-water-equations.md): Height field normals feed the caustic refraction pass in an interactive pool.

## Combination ideas

- [Bathymetry-refracted coastal ocean with shore caustics](https://texelatlas.vercel.app/ideas/eikonal-refracted-fft-shore-caustics/)
- [Meshlet kelp forests through underwater PSF scattering](https://texelatlas.vercel.app/ideas/meshlet-kelp-small-angle-underwater-psf/)

## Sources

1. [primary] Chris Wyman, Scott Davis (2006) Interactive image-space techniques for approximating caustics. Proceedings of the 2006 symposium on Interactive 3D graphics and games  - SI3D '06. https://doi.org/10.1145/1111411.1111439 (verified via crossref on 2026-11-29)
2. [primary] Musawir A. Shah, Jaakko Konttinen, Sumanta Pattanaik (2007) Caustics Mapping: An Image-Space Technique for Real-Time Caustics. IEEE Transactions on Visualization and Computer Graphics. https://doi.org/10.1109/tvcg.2007.32 (verified via crossref on 2026-11-29)
3. [implementation] evanw (2015) evanw/webgl-water. https://github.com/evanw/webgl-water (verified via github on 2026-11-29)
4. [implementation] Gökay Aydoğan (2026) gokayfem/glsl-studies. https://github.com/gokayfem/glsl-studies License: MIT. (verified via github on 2026-11-30)

## Cite this entry

Texel. "Real-time Water Caustics." https://texelatlas.vercel.app/t/water-caustics-realtime/ (accessed 2026-12-01).
