pub enum ShadowMatrices {
Single(Mat4),
Cube(Box<[Mat4; 6]>),
}Expand description
View-projection matrices a single shadow-casting light publishes.
Two variants reflect the two atlas binding surfaces consumed by the lit shader: directional / spot use a single matrix sampled against the 2D depth-array atlas, point lights use six matrices sampled against the cubemap atlas.
Cube is significantly larger than Single (6 × Mat4 ≈ 384 B vs
Mat4 ≈ 64 B). The variants are boxed to even out memory usage, since
most lights are directional / spot and a fat enum would inflate the
per-frame HashMap<usize, ShadowMatrices>.
Variants§
Single(Mat4)
One view-projection — directional or spot light.
Cube(Box<[Mat4; 6]>)
Six view-projections in [khora_core::math::CubeFace::ALL] order
([+X, -X, +Y, -Y, +Z, -Z]) — point light.
Trait Implementations§
Source§impl Clone for ShadowMatrices
impl Clone for ShadowMatrices
Source§fn clone(&self) -> ShadowMatrices
fn clone(&self) -> ShadowMatrices
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShadowMatrices
impl RefUnwindSafe for ShadowMatrices
impl Send for ShadowMatrices
impl Sync for ShadowMatrices
impl Unpin for ShadowMatrices
impl UnsafeUnpin for ShadowMatrices
impl UnwindSafe for ShadowMatrices
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
Mutably borrows from an owned value. Read more