#[repr(C)]pub struct SpotShadowData {
pub light_vp: [[f32; 4]; 4],
pub depth_bias: f32,
pub normal_bias: f32,
pub _pad: [f32; 2],
}Expand description
One shadowed spot light’s slice of the spot shadow map array. Indexed by
GpuLight.shadow_index; the index doubles as the array slice. Uploaded once
per scene, since local lights are static.
80 bytes: the matrix fills the first four 16-byte lanes and the three scalars plus a pad fill the fifth, so the MSL (float4x4 + floats), HLSL (no 16-byte straddle), and GLSL std430 (mat4 align-16) layouts all agree.
Fields§
§light_vp: [[f32; 4]; 4]World -> light clip matrix for this spot, column-major.
depth_bias: f32Constant depth offset applied when comparing against the stored depth.
normal_bias: f32Offset along the surface normal before projecting, which suppresses shadow acne on surfaces near-parallel to the light.
_pad: [f32; 2]Padding so the field layout matches the shader-side struct.
Implementations§
Source§impl SpotShadowData
impl SpotShadowData
Sourcepub const ZERO: SpotShadowData
pub const ZERO: SpotShadowData
An all-zero slice, used to fill unused entries.
Trait Implementations§
Source§impl Clone for SpotShadowData
impl Clone for SpotShadowData
Source§fn clone(&self) -> SpotShadowData
fn clone(&self) -> SpotShadowData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more