#[repr(C)]pub struct TransparentView {
pub vp: [[f32; 4]; 4],
pub inv_vp: [[f32; 4]; 4],
pub camera_pos: [f32; 4],
pub viewport: [f32; 2],
pub time: f32,
pub prefilter_mip_count: f32,
pub sky_rot: [[f32; 4]; 3],
pub sun_dir: [f32; 4],
pub sun_color: [f32; 4],
}Expand description
Per-frame view inputs shared by every draw in the transparent pass (water,
glass), bound once for the whole pass. Matches TransparentView in
shaders/glass.slang and shaders/water.slang. 240 bytes.
Fields§
§vp: [[f32; 4]; 4]View-projection matrix, column-major.
inv_vp: [[f32; 4]; 4]Inverse view-projection matrix, column-major.
camera_pos: [f32; 4]World-space camera position (xyz). .w is ignored by the shader.
viewport: [f32; 2]Render-target width / height in pixels: the shader uses this to turn its fragment position into a normalised screen UV.
time: f32Wall-clock seconds since startup, fed to the Gerstner sum.
prefilter_mip_count: f32Mip count of the bound IBL prefilter cube; 0 signals “no environment map”, where the glass reflection falls back to a white rim. Per-frame state, so it rides the shared view rather than a per-draw params block.
sky_rot: [[f32; 4]; 3]Rows of the rotation taking a world-space direction into the environment
cubemap’s baked frame, mirroring ViewUniforms.sky_rot so this pass’s
sky taps turn with the main one. One float4 per row; w is unused.
sun_dir: [f32; 4][x, y, z, _]: unit direction toward the scene’s sun, the first
directional light. Zero when the world declares none.
sun_color: [f32; 4][r, g, b, _]: that light’s colour times its intensity, which the water
glint scales by. Zero when the world declares no directional light, and
the shader draws no glint.
Trait Implementations§
Source§impl Clone for TransparentView
impl Clone for TransparentView
Source§fn clone(&self) -> TransparentView
fn clone(&self) -> TransparentView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more