pub struct CsmSystem {
pub cascades: Vec<ShadowCascade>,
pub stabilize: bool,
pub blend_band: f32,
pub debug_vis: bool,
}Expand description
Full cascaded shadow map system.
Fields§
§cascades: Vec<ShadowCascade>§stabilize: bool§blend_band: f32§debug_vis: boolImplementations§
Source§impl CsmSystem
impl CsmSystem
pub fn new(cascade_splits: &[f32], base_resolution: u32) -> Self
pub fn default_3_cascade() -> Self
pub fn update( &mut self, light_dir: Vec3, camera_pos: Vec3, camera_forward: Vec3, fov: f32, aspect: f32, )
Sourcepub fn cascade_for_distance(&self, dist: f32) -> Option<usize>
pub fn cascade_for_distance(&self, dist: f32) -> Option<usize>
Find which cascade index should be used for a given distance from camera.
Sourcepub fn cascade_color(index: usize) -> Vec3
pub fn cascade_color(index: usize) -> Vec3
Generate debug cascade color (for visualization).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CsmSystem
impl RefUnwindSafe for CsmSystem
impl Send for CsmSystem
impl Sync for CsmSystem
impl Unpin for CsmSystem
impl UnsafeUnpin for CsmSystem
impl UnwindSafe for CsmSystem
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