pub struct LightingSettings {
pub lights: Vec<LightSource>,
pub shadow_bias: f32,
pub shadows_enabled: bool,
pub sky_color: [f32; 3],
pub ground_color: [f32; 3],
pub hemisphere_intensity: f32,
pub shadow_extent_override: Option<f32>,
pub shadow_cascade_count: u32,
pub cascade_split_lambda: f32,
pub shadow_atlas_resolution: u32,
pub shadow_filter: ShadowFilter,
pub pcss_light_radius: f32,
}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§
§lights: Vec<LightSource>Active light sources (max 8). Default: one directional light.
shadow_bias: f32Shadow map depth bias to reduce shadow acne. Default: 0.0001.
shadows_enabled: boolWhether shadow maps are computed and sampled. Default: true.
sky_color: [f32; 3]Sky color for hemisphere ambient. Default [0.8, 0.9, 1.0].
ground_color: [f32; 3]Ground color 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 or from domain_extents). 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.
cascade_split_lambda: f32Blend factor between logarithmic and linear cascade splits (0.0 = linear, 1.0 = log). Default: 0.75. Higher values allocate more resolution near the camera.
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.
Trait Implementations§
Source§impl Clone for LightingSettings
impl Clone for LightingSettings
Source§fn clone(&self) -> LightingSettings
fn clone(&self) -> LightingSettings
1.0.0 · 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
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<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.