#[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 moreimpl Copy for SpotShadowData
Source§impl Debug for SpotShadowData
impl Debug for SpotShadowData
impl NoUninit for SpotShadowData
Auto Trait Implementations§
impl Freeze for SpotShadowData
impl RefUnwindSafe for SpotShadowData
impl Send for SpotShadowData
impl Sync for SpotShadowData
impl Unpin for SpotShadowData
impl UnsafeUnpin for SpotShadowData
impl UnwindSafe for SpotShadowData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more