Read-only sampler for the live ocean surface. Lets non-rendering code (e.g.
floating objects) query the water height at any world X/Z, in sync with the
animated wave field shown on screen.
The height is summed from the same spectral wave components the shader uses
(uWaveA/uWaveB + uTime, read by reference from the material), so it
always matches the current sea state, wind and animation time. The optional
Gerstner horizontal displacement and the render-time footprint LOD fade are
intentionally ignored — they are visual-only refinements, not needed for a
plausible floating response, and skipping them keeps sampling cheap.
Coordinates are in the Ocean group's local frame (sea level = local y 0),
which equals world space for the typical flat, unrotated planar ocean.
Read-only sampler for the live ocean surface. Lets non-rendering code (e.g. floating objects) query the water height at any world X/Z, in sync with the animated wave field shown on screen.
The height is summed from the same spectral wave components the shader uses (
uWaveA/uWaveB+uTime, read by reference from the material), so it always matches the current sea state, wind and animation time. The optional Gerstner horizontal displacement and the render-time footprint LOD fade are intentionally ignored — they are visual-only refinements, not needed for a plausible floating response, and skipping them keeps sampling cheap.Coordinates are in the Ocean group's local frame (sea level = local y 0), which equals world space for the typical flat, unrotated planar ocean.