Module water_surface
Expand description
Caller-buffered shoreline attributes, Gerstner spectra, buoyancy, optics, and ripples for open water.
Modules§
- buoyancy
- Multi-Sphere Archimedes Buoyancy Solver & Hydrological State Machine.
- gerstner
- Zero-Heap Gerstner Wave Spectrum & Nearshore Attenuation Engine.
- optics
- Hydrologic Optics, Radiative Transfer & Dielectric BSDF Engine.
- ripple
- 2D Interactive Ripple Buffer & Dynamic Wave Equation Solver.
- shoreline
- spatial
- Cold caller-buffered native BVH construction and allocation-free nearest shoreline queries. Exact segment distances remain the acceptance criterion.
Structs§
- Aabb
- Axis-aligned bounding box in 3D.
- Archimedes
Proxy - Multi-sphere proxy hull for volumetric character buoyancy.
- BioGeo
Optical Constituents - Ecological and Geomorphic Bio-Geo-Optical constituents (CASE-2 Waters).
- Buoyancy
Result - Instantaneous buoyancy evaluation result.
- Buoyancy
Sphere - Sphere element of an Archimedes buoyancy hull.
- BvhNode
- BVH node: 40 bytes,
repr(C), naturally aligned. - Dielectric
Volume Iop - Inherent Optical Properties (IOP) of a dielectric medium or fluid volume.
- Gerstner
Wave - Individual Gerstner wave harmonic component.
- Hydrological
Hysteresis Gate - Hysteresis gate to filter high-frequency fluid noise before committing discrete transitions.
- Interactive
Ripple Buffer - A zero-heap 2D discrete wave heightfield solver.
- Point2
- 2D point in double precision for shoreline segment distance queries.
- Point3
- 3D point in double precision for AABB and BVH queries.
- Shore
Receipt - Shore
Spatial Scratch - Shore
Topology - Simd
Gerstner Spectrum - 8-harmonic Gerstner wave spectrum for zero-allocation CPU water queries.
Enums§
- Allocation
Class - Allocation classification for water surface geometry passes.
- BvhError
- Errors raised by the BVH builder.
- Shore
Error - Spatial
Order Error - Errors raised by spatial ordering functions.
- Submersion
State - Locomotion and submersion mode of an entity.
Constants§
- ALLOCATION_
CLASS - BVH_
NODE_ SIZE - Node size in bytes.
- GRAVITY_
M_ S2 - Gravity constant in m/s².
- MAX_
BUOYANCY_ SPHERES - Maximum number of buoyancy proxy spheres per character/rigid-body hull.
- MAX_
BVH_ DEPTH - Maximum BVH depth (bounded by 2^21 primitives -> 21 levels).
- MAX_
GERSTNER_ HARMONICS - Maximum number of analytical wave components evaluated simultaneously.
- PURE_
WATER_ ABSORPTION_ RGB - Pure H2O molecular absorption coefficients in m⁻¹ at 20°C (Smith & Baker, 1981).
- PURE_
WATER_ RAYLEIGH_ RGB - Pure H2O molecular Rayleigh scattering coefficients in m⁻¹.
- RIPPLE_
GRID_ DIM - RIPPLE_
TOTAL_ CELLS - SPATIAL_
BUILD_ ALLOCATION_ CLASS - The optional spatial builder delegates to the native bounded cold BVH lifecycle; nearest-edge traversal itself stays allocation-free.
- WATER_
DENSITY_ KG_ M3 - Standard water density in kg/m³ (freshwater = 1000.0, ocean = 1025.0).
- WAVELENGTH_
BLUE_ NM - WAVELENGTH_
GREEN_ NM - WAVELENGTH_
RED_ NM - Wavelength standards in nanometers: Red (650 nm), Green (532 nm), Blue (450 nm).
Functions§
- build_
bvh_ recursive - Build a BVH using the deterministic Morton-sorted recursive builder.
- point_
segment_ distance_ sq_ 2d - Squared distance from point
pto segmentabin 2D. - sample_
combined_ water_ surface - Combines an analytical Gerstner wave spectrum with a local dynamic interactive ripple buffer.
- shore_
distance_ accelerated_ into - Accelerated shore-distance field into
out. - shore_
distance_ into - Allocation-free reference calculation; accelerated loading shares its topology.
- shore_
topology_ into - Distance in mesh X/Z units to the nearest topological boundary edge.
edgesis reusable scratch, one u64 per triangle index plus input vertex. Sorted undirected edge keys compact boundary edges in place; no heap is allocated. Separate surfaces keep separate boundaries. Streamed tile seams need shared topology before this authoring pass, not a shader guess about their outline. - sort_
by_ morton_ 3d - Compute Morton codes for a 3D point set and sort indices by code.
- spatial_
working_ bytes - Includes caller arrays and the native BVH builder’s bounded centroid scratch.