#[repr(C)]pub struct WaterParams {Show 13 fields
pub centre: [f32; 4],
pub deep_colour: [f32; 4],
pub shallow_colour: [f32; 4],
pub depth_falloff: f32,
pub foam_width: f32,
pub foam_intensity: f32,
pub fresnel_power: f32,
pub roughness: f32,
pub refraction_strength: f32,
pub wave_count: u32,
pub _pad: f32,
pub waves: [WaterWaveGpu; 4],
pub planar: [f32; 4],
}Expand description
Per-surface tunables for a WaterSurface, uploaded once per surface. The
vec3-ish fields are [f32; 4] so the layout is byte-identical to the
shader’s float4. Matches WaterParams in shaders/water.slang. 224 bytes.
Fields§
§centre: [f32; 4][x, y, z, _]: world-space surface centre.
deep_colour: [f32; 4][r, g, b, _]: water tint at full column depth.
shallow_colour: [f32; 4][r, g, b, _]: water tint just above the seabed.
depth_falloff: f32Depth over which the tint blends from shallow to deep, in metres.
foam_width: f32Width of the shoreline foam band, in world units.
foam_intensity: f32Foam brightness multiplier.
fresnel_power: f32Exponent of the Fresnel reflectance curve.
roughness: f32Perceptual roughness in [0, 1]; picks the reflection’s prefilter mip.
refraction_strength: f32How far refraction offsets the sampled background.
wave_count: u32Live entries in waves.
_pad: f32Padding so the field layout matches the shader-side struct.
waves: [WaterWaveGpu; 4]Wave coefficients; the first wave_count entries are live.
planar: [f32; 4]Planar reflection control: [strength, distortion, _, _]. strength > 0.5 selects the sharp planar reflection (the scene re-rendered mirrored
across this surface’s rest plane, sampled at screen UV) over the probe /
sky cube; distortion scales the wave-normal ripple offset of that
lookup. 0 when planar is off (RT on, no planar slot, or the plane
overflowed the budget), keeping the probe / sky path.
Trait Implementations§
Source§impl Clone for WaterParams
impl Clone for WaterParams
Source§fn clone(&self) -> WaterParams
fn clone(&self) -> WaterParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more