Oceans and Shallow Water

Three water surfaces share one query interface, so a boat floats on any of them the same way.

Surface What it is Use it for
FFT ocean Tessendorf spectral ocean: JONSWAP, Pierson–Moskowitz, Phillips and TMA spectra with directional spreading, finite depth, choppy displacement, foam, orbital velocity, several cascades open sea for VFX, ship and offshore motion
Gerstner waves analytic sum of trochoidal waves, evaluable at any time stylised swell, very cheap queries
Shallow water 2-D finite-volume Saint-Venant solver: well-balanced, positivity preserving, wet and dry, two-way coupled with rigid bodies floods, dam breaks, rivers, run-up, pools with floating debris

Bodies float with exact per-collider buoyancy (the submerged volume of each collider's mesh) and orbital drag, so a trawler pitches on a swell and a barge settles at its draft.

In Divooka

On a graphics card that supports Vulkan: the FFT ocean with floating bodies and triggers (ContinuumOcean, OceanSession), its displacement, normal and foam maps exported per frame; and a shoreline with waves, run-up and foam over a beach or a height map (ContinuumShore, ShoreSession). Gerstner waves are planned.

Validation

Test Result
Significant wave height of a synthesised JONSWAP sea +0.02 % against the spectrum
Phase speed of single modes, deep and finite depth equal to linear theory to 4 decimals
Orbital velocity within 2.8e-4 m/s of linear theory
Shallow-water dam break against Ritter's solution L1 depth error 0.18 %, mass error 5e-8
Lake at rest over bumps with dry cells velocities below 1e-5 m/s
Uniform channel against Manning's normal depth within 1.4 %
Floating box (500 kg/m³) in shallow water draft 0.2499 m against 0.25 m
1 and 3 threads bit-identical; no allocation per step

Cost

An FFT ocean of 256² with two cascades costs about 9 ms per step on two threads; shallow water at 512² about 9 ms per sub-step. The catalog's boats on an FFT sea run at about 2 ms per frame at preview quality.

Limits

  • The FFT ocean is one-way: bodies and blasts make no waves on it.
  • Shallow water is a height field: no overturning waves or 3-D splashes (use SPH or FLIP for those).

Sample scenes

ocean-boats, shallow-water-flood, floating-blocks, wave-lab, harbor-blast.