Camera the grid follows. Can be swapped at any time.
ReadonlyobjectThe ocean mesh. Added to scene for you when one is passed to Ocean.create.
Resolved settings. Change them with Ocean.set / Ocean.reset.
ReadonlystatsLive counters, refreshed by Ocean.update.
Seconds of wave time. Advanced by Ocean.update; set it to sync clients.
ReadonlyuniformsShader uniforms (for advanced tweaks).
Σ k·chop of the waves (normalises whitecaps).
deepColor.
detail.
Unit drift direction of the ripples (x, z).
detailScale, metres.
detailSpeed, m/s.
environmentIntensity.
Seconds per flow-map cycle (rivers).
foam, 0 … 1.
foamColor.
foamWidth, metres.
Vertex spacing per metre of distance (2π / segments for the ocean rings; 0 = uniform grid).
Smallest vertex spacing, metres. Waves shorter than ~3 spacings fade out in the vertex stage.
Multiplier from geometry x/z to tangent-plane metres (the ocean's ring scale).
horizonColor.
Surface distance beyond which vertices are clamped (the horizon on planets).
Sphere radius the surface bends to (sea radius on planets; huge = flat).
Flow speed (m/s) where river rapids start foaming.
reflectivity (F0).
refraction.
roughness.
shallowColor.
skyColor.
specular.
Sun colour × intensity.
Direction towards the sun, world space.
tan(fov / 2) of the camera, for the per-pixel detail fade.
Seconds, advanced by the owner's update().
visibility, metres.
Per wave: direction x, direction z, wavenumber k, amplitude.
Per wave: horizontal amplitude (chop), phase (radians, includes −ωt), unused, unused.
Active entries in waveA/waveB.
Whitecap amount 0 … 1 (oceans and lakes).
World providing sea level and planet radius, or null to use the seaLevel/radius settings.
Removes the ocean from its parent and frees its GPU resources.
Replaces all settings: anything not in input goes back to the defaults.
Changes settings, merging into earlier ones (waves field by field). Colours and most numbers apply instantly; segments/range rebuild the grid.
Moves the floating origin: render-space (0, 0, 0) becomes this world position (e.g. from FloatingOrigin.onRebase). Same as set({ origin }).
Follows the camera, advances the waves and reads the sun. Called automatically when a scene was
given (and by <Ocean>); otherwise call it once per frame.
Seconds since the last frame; measured if omitted.
The wavy sea surface at a render-space point, for buoyancy and gameplay: how deep the point is under the surface, the surface point and its normal. Uses every wave (no distance fade), at the current Ocean.time.
StaticcreateCreates an ocean (validating/initialising renderer if given) and positions it for the first frame.
A sea-level water surface for flat worlds and planets, at every scale from an ant on the beach to orbit, in one draw call.
The surface is a camera-centred grid of concentric rings whose radii grow geometrically, so vertices are dense under the camera and sparse at the horizon, and the grid scales with the camera's height. It is built in the local tangent plane under the camera and, on planets, bent onto the sea sphere in the vertex shader (with float32-exact series), clamped at the horizon — so the same mesh covers a beach and a whole hemisphere seen from orbit. Waves are a sum of Gerstner waves whose phases are computed on the CPU in float64, so they stay smooth and stable millions of metres from the origin.
Example