Feature Library

Water ripples, wakes & caustics

0.32 GPU · 0.23 CPU ms
A still of the Water ripples, wakes & caustics demo
Still
The live demo starts when it’s in view.Click the water to splash · drag to orbit

The wave equation as compute on a ring of cells that follows the camera, a smooth Catmull-Rom read, an absorbing edge and a coarse second field for long wakes…

What it costs a frame

0.32 ms
0.23 ms
GPU
0.32 ms
CPU, median
0.23 ms
CPU, 95th pct
0.42 ms
Draw calls
8
Weight
Light

Measured 3 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool0.320.230.42
apple · Apple A19 Proin a browser tab · 16 November 20263.900.661.06
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20261.640.510.83

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
three.js 0.187.0No other packages

What it’s for

  1. Pools, ponds and lakes
  2. Boat and swimmer wakes
  3. Rain on water
  4. Splashes from impacts
  5. Puddles

Pitfalls, in brief

  1. A render-target step flips rows under WebGPU and mirrors every wake: keep the field in storage buffers (a ring of cells addressed by world cell modulo its size), as here.
  2. Without WebGPU (three’s WebGL2 backend: no compute), pass textures: WaterWakes.needsTextures(renderer): the same step, cell for cell, as render-target ping-pong in 32-bit float targets (the cells’ world tags are whole numbers a half float cannot hold), every read a textureLoad.
  3. A four-cell smoothstep read terraces the rings (flat at every cell centre): read the slope with Catmull-Rom over 4×4 cells for the surface.
  4. Without an absorbing edge, waves bounce back off the field’s square border; without a faded read, the wake stops at a hard line.
  5. Nine-cell neighbourhood, not five: the four sides alone spread a wave as a diamond.
3 more in brief
  1. The step runs at a fixed 30 Hz and the shader eases between the last two slopes; a drop on a frame with no step due must still land (the update forces one).
  2. The surface reads the frame drawn so far (viewportSharedTexture): draw the bed first, the water after it (transparent, renderOrder), one frame copy a frame.
  3. three r187: a shared frame copy (viewportSharedTexture) can be created 8-bit before the renderer’s half-float frame target exists; then every copy fails (“Source and destination formats do not match”) and the refraction shows nothing.
8 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

Evan Wallace, WebGL Water: The ripple step is his wave equation (height pulled toward the neighbours’ average, damped), and the caustics follow his idea: compare where refracted rays land through a flat and a wavy surface.

jeantimex/webgpu-water: A WebGPU port of Wallace’s water that inspired moving the step to compute and the roadmap (caustics, refraction, floating things).

wave equationcomputecausticsrefractioncatmull-romstorage bufferstsl

Near it in the frame