Enum ShadowEntry
pub enum ShadowEntry {
Atlas2D {
view_proj: Mat4,
atlas_index: i32,
},
Cube {
face_view_projs: Box<[Mat4; 6]>,
cube_array_index: i32,
light_pos: Vec3,
far_plane: f32,
},
}Expand description
Shadow data computed by a shadow strategy for a single light.
Two variants reflect the two atlas binding surfaces:
ShadowEntry::Atlas2D— directional / spot, sampled with one view-projection matrix against atexture_depth_2d_array.ShadowEntry::Cube— point lights, sampled directionally against atexture_depth_cube_array. The CPU-side per-face matrices are kept on the entry so the strategy can rebuild bind data without re-running its source flow.
Cube is boxed to keep the enum size close to Atlas2D (most
lights in a typical scene are directional / spot).
Variants§
Atlas2D
Directional / spot shadow stored in the 2D depth-array atlas.
Fields
§
view_proj: Mat4Light’s view-projection matrix used to sample the shadow atlas.
Cube
Point-light omnidirectional shadow stored in the cubemap atlas.
Fields
§
face_view_projs: Box<[Mat4; 6]>Per-face view-projection matrices in
[crate::math::CubeFace::ALL] order
([+X, -X, +Y, -Y, +Z, -Z]).
§
cube_array_index: i32Layer index inside the cube-array atlas (the GPU consumes
cube_array_index * 6 + face_index to address a face).
§
light_pos: Vec3World-space light position. The shader uses this to compute the fragment-to-light direction it samples the cubemap with.
Trait Implementations§
§impl Clone for ShadowEntry
impl Clone for ShadowEntry
§fn clone(&self) -> ShadowEntry
fn clone(&self) -> ShadowEntry
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 ShadowEntry
impl RefUnwindSafe for ShadowEntry
impl Send for ShadowEntry
impl Sync for ShadowEntry
impl Unpin for ShadowEntry
impl UnsafeUnpin for ShadowEntry
impl UnwindSafe for ShadowEntry
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