#[non_exhaustive]pub struct LightingSettings {
pub lights: Vec<LightSource>,
pub shadow_bias: f32,
pub shadows_enabled: bool,
pub sky_colour: [f32; 3],
pub ground_colour: [f32; 3],
pub hemisphere_intensity: f32,
pub shadow_extent_override: Option<f32>,
pub shadow_cascade_count: u32,
pub shadow_atlas_resolution: u32,
pub shadow_filter: ShadowFilter,
pub pcss_light_radius: f32,
pub debug_vis: DebugVis,
}Expand description
Per-frame lighting configuration for the viewport.
Supports up to 8 light sources. Only lights[0] casts shadows.
Blinn-Phong shading coefficients (ambient, diffuse, specular, shininess) have
moved to per-object [Material] structs.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.lights: Vec<LightSource>Active light sources (max 8). Default: one directional light.
shadow_bias: f32Constant NDC depth bias subtracted from the receiver comparison depth. Default: 0.0.
shadows_enabled: boolWhether shadow maps are computed and sampled. Default: true.
sky_colour: [f32; 3]Sky colour for hemisphere ambient. Default [0.8, 0.9, 1.0].
ground_colour: [f32; 3]Ground colour for hemisphere ambient. Default [0.3, 0.2, 0.1].
hemisphere_intensity: f32Hemisphere ambient intensity. 0.0 = disabled. Default 0.0.
shadow_extent_override: Option<f32>Override the shadow frustum half-extent (world units). None = auto (20.0). Tighter values improve shadow map texel density and reduce contact-shadow penumbra.
shadow_cascade_count: u32Number of cascaded shadow map splits (1-4). Default: 4.
shadow_atlas_resolution: u32Shadow atlas resolution (width = height). Default: 4096.
Each cascade tile is atlas_resolution / 2.
shadow_filter: ShadowFilterShadow filtering mode. Default: PCF.
pcss_light_radius: f32PCSS light source radius in shadow-map UV space. Controls penumbra width. Default: 0.02.
debug_vis: DebugVisDebug visualization configuration. Off by default (zero overhead when inactive).
Trait Implementations§
Source§impl Clone for LightingSettings
impl Clone for LightingSettings
Source§fn clone(&self) -> LightingSettings
fn clone(&self) -> LightingSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LightingSettings
impl Debug for LightingSettings
Auto Trait Implementations§
impl Freeze for LightingSettings
impl RefUnwindSafe for LightingSettings
impl Send for LightingSettings
impl Sync for LightingSettings
impl Unpin for LightingSettings
impl UnsafeUnpin for LightingSettings
impl UnwindSafe for LightingSettings
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.