How it worksA Gerstner wave doesn't just bob the surface up and down — it also rolls each point in a small circle, bunching vertices toward the crests, which is what gives real ocean waves their sharp peaks and broad troughs. Two dozen of them, with wavelengths, directions and amplitudes drawn from an ocean spectrum around the wind, are summed in the vertex shader; because the formula is analytic the exact normal — and how the surface folds — come with it for free. Where that fold turns the surface back on itself (its Jacobian goes negative) the water is pinching into a breaking crest, and that's where the foam is laid. Those normals drive a Fresnel blend (reflective sky at grazing angles, deep blue looking straight down) and the sun glint; the choppiness slider scales how far each wave rolls horizontally.