Skip to main content

CsmCascadeSplits

Struct CsmCascadeSplits 

Source
pub struct CsmCascadeSplits { /* private fields */ }
Expand description

Practical-Split Cascaded Shadow Map configuration and texel-snapped cascade matrices.

Implementations§

Source§

impl CsmCascadeSplits

Practical-split Cascaded Shadow Map calculation and cascade selection for CsmCascadeSplits.

Source

pub fn compute( camera: &Camera3D, aspect: f32, light_dir: Vec3, cascade_count: usize, lambda: f32, max_distance: f32, resolution: u32, ) -> Self

Computes Practical-Split Cascaded Shadow Map splits with rotation-invariant bounding spheres and light-space texel snapping.

§Arguments
  • &Camera3D - Active 3D perspective camera.
  • f32 - Viewport width-to-height aspect ratio.
  • Vec3 - Unit direction vector pointing toward the directional light.
  • usize - Requested cascade count (clamped to 1..=CSM_MAX_CASCADES).
  • f32 - Practical split lambda in [0.0, 1.0] (0.0 uniform, 1.0 logarithmic).
  • f32 - Maximum world-space shadow coverage distance in meters.
  • u32 - Square shadow map edge resolution in texels.
§Returns
  • Self - Texel-snapped directional shadow cascades.
Source

pub fn select_cascade(&self, view_depth: f32) -> usize

Selects the active cascade index covering positive camera-space view_depth.

§Arguments
  • f32 - Positive distance along camera forward axis in meters.
§Returns
  • usize - Active cascade slice index in 0..cascade_count.
Source§

impl CsmCascadeSplits

Implements impl #impl_generics #name #ty_generics #where_clause.

Source

pub fn get_cascade_count(&self) -> usize

Source

pub fn get_mut_cascade_count(&mut self) -> &mut usize

Source

pub fn set_cascade_count(&mut self, val: usize) -> &mut Self

Source

pub fn get_lambda(&self) -> f32

Source

pub fn get_mut_lambda(&mut self) -> &mut f32

Source

pub fn set_lambda(&mut self, val: f32) -> &mut Self

Source

pub fn get_near_plane(&self) -> f32

Source

pub fn get_mut_near_plane(&mut self) -> &mut f32

Source

pub fn set_near_plane(&mut self, val: f32) -> &mut Self

Source

pub fn get_far_plane(&self) -> f32

Source

pub fn get_mut_far_plane(&mut self) -> &mut f32

Source

pub fn set_far_plane(&mut self, val: f32) -> &mut Self

Source

pub fn get_shadow_map_resolution(&self) -> u32

Source

pub fn get_mut_shadow_map_resolution(&mut self) -> &mut u32

Source

pub fn set_shadow_map_resolution(&mut self, val: u32) -> &mut Self

Source

pub fn get_slices(&self) -> [CsmCascadeSlice3D; 4]

Source

pub fn get_mut_slices(&mut self) -> &mut [CsmCascadeSlice3D; 4]

Source

pub fn set_slices(&mut self, val: [CsmCascadeSlice3D; 4]) -> &mut Self

Trait Implementations§

Source§

impl Clone for CsmCascadeSplits

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CsmCascadeSplits

Source§

impl Debug for CsmCascadeSplits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CsmCascadeSplits

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CsmCascadeSplits

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.