pub struct ShadowConfig {
pub max_distance: f32,
pub fade_start: f32,
pub atlas_resolution: u32,
pub default_resolution: u32,
pub bias: ShadowBias,
pub pcf_mode: PcfMode,
pub use_vsm: bool,
pub max_shadow_casters: u32,
pub cull_shadow_casters: bool,
}Expand description
Global shadow configuration.
Fields§
§max_distance: f32Maximum shadow distance from the camera.
fade_start: f32Distance at which shadows start fading out.
atlas_resolution: u32Atlas resolution (width and height).
default_resolution: u32Default shadow map resolution per light.
bias: ShadowBiasDefault bias settings.
pcf_mode: PcfModePCF kernel to use (3x3 or 5x5).
use_vsm: boolWhether to use variance shadow maps.
max_shadow_casters: u32Maximum number of shadow-casting lights.
cull_shadow_casters: boolWhether to enable shadow caster culling.
Implementations§
Source§impl ShadowConfig
impl ShadowConfig
Sourcepub fn distance_fade(&self, distance: f32) -> f32
pub fn distance_fade(&self, distance: f32) -> f32
Compute shadow distance fade factor (1.0 = full shadow, 0.0 = faded).
Sourcepub fn create_pcf_kernel(&self) -> PcfKernel
pub fn create_pcf_kernel(&self) -> PcfKernel
Create a PCF kernel based on the current mode.
Trait Implementations§
Source§impl Clone for ShadowConfig
impl Clone for ShadowConfig
Source§fn clone(&self) -> ShadowConfig
fn clone(&self) -> ShadowConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShadowConfig
impl Debug for ShadowConfig
Auto Trait Implementations§
impl Freeze for ShadowConfig
impl RefUnwindSafe for ShadowConfig
impl Send for ShadowConfig
impl Sync for ShadowConfig
impl Unpin for ShadowConfig
impl UnsafeUnpin for ShadowConfig
impl UnwindSafe for ShadowConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.