pub struct VolumetricLightShafts {
pub sample_count: u32,
pub density: f32,
pub weight: f32,
pub decay: f32,
pub exposure: f32,
pub light_screen_pos: (f32, f32),
pub light_color: Color,
pub enabled: bool,
}Expand description
God rays via radial blur from a light’s screen position.
Fields§
§sample_count: u32Number of samples along each ray.
density: f32Density of the light shaft effect (0..1).
weight: f32Weight for combining scattered light.
decay: f32Decay factor per sample along the ray.
exposure: f32Exposure multiplier.
light_screen_pos: (f32, f32)Light screen-space position (0..1 in each axis). Updated per frame.
light_color: ColorLight color for the shafts.
enabled: boolWhether the effect is enabled.
Implementations§
Source§impl VolumetricLightShafts
impl VolumetricLightShafts
pub fn new(sample_count: u32) -> Self
Sourcepub fn update_light_position(
&mut self,
light_world_pos: Vec3,
view_projection: &Mat4,
)
pub fn update_light_position( &mut self, light_world_pos: Vec3, view_projection: &Mat4, )
Update the light’s screen position from a world position and view-projection matrix.
Sourcepub fn is_light_visible(&self) -> bool
pub fn is_light_visible(&self) -> bool
Check if the light is on screen.
Trait Implementations§
Source§impl Clone for VolumetricLightShafts
impl Clone for VolumetricLightShafts
Source§impl Debug for VolumetricLightShafts
impl Debug for VolumetricLightShafts
Auto Trait Implementations§
impl Freeze for VolumetricLightShafts
impl RefUnwindSafe for VolumetricLightShafts
impl Send for VolumetricLightShafts
impl Sync for VolumetricLightShafts
impl Unpin for VolumetricLightShafts
impl UnsafeUnpin for VolumetricLightShafts
impl UnwindSafe for VolumetricLightShafts
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
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>
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ⓘ
Converts
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> ⓘ
Converts
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 more