THREE.JS / FOUNDATIONS 54

The surface has memory.

A height field lives in GPU storage, ping-pongs through a wave update, and returns to the vertex stage as geometry and normals.

Initializing compute water—
Preparing the 128×128 height field and wave kernels…

Click and drag across the pool to inject a disturbance. The update reads neighboring heights, subtracts the previous field, and writes the next ping-pong buffer; the mesh reads whichever buffer is current.

LAB 54 / COMPUTE WATER