pub struct VolumetricSystem {
pub light_shafts: VolumetricLightShafts,
pub fog: VolumetricFog,
pub tiled_culling: Option<TiledLightCulling>,
pub clustered_assignment: Option<ClusteredLightAssignment>,
pub shafts_enabled: bool,
pub fog_enabled: bool,
pub tiled_culling_enabled: bool,
pub clustered_enabled: bool,
}Expand description
Orchestrates all volumetric effects.
Fields§
§light_shafts: VolumetricLightShafts§fog: VolumetricFog§tiled_culling: Option<TiledLightCulling>§clustered_assignment: Option<ClusteredLightAssignment>§shafts_enabled: boolWhether volumetric light shafts are enabled.
fog_enabled: boolWhether volumetric fog is enabled.
tiled_culling_enabled: boolWhether tiled culling is active.
clustered_enabled: boolWhether clustered assignment is active.
Implementations§
Source§impl VolumetricSystem
impl VolumetricSystem
pub fn new() -> Self
Sourcepub fn init_tiled_culling(&mut self, width: u32, height: u32, tile_size: u32)
pub fn init_tiled_culling(&mut self, width: u32, height: u32, tile_size: u32)
Initialize tiled light culling for the given screen resolution.
Sourcepub fn init_clustered(
&mut self,
clusters_x: u32,
clusters_y: u32,
clusters_z: u32,
near: f32,
far: f32,
fov_y: f32,
aspect: f32,
)
pub fn init_clustered( &mut self, clusters_x: u32, clusters_y: u32, clusters_z: u32, near: f32, far: f32, fov_y: f32, aspect: f32, )
Initialize clustered forward rendering.
Sourcepub fn update_tiled(
&mut self,
lights: &[(LightId, &Light)],
depth_buffer: &[f32],
)
pub fn update_tiled( &mut self, lights: &[(LightId, &Light)], depth_buffer: &[f32], )
Update tiled light culling with current lights and depth buffer.
Sourcepub fn update_clustered(&mut self, lights: &[(LightId, &Light)])
pub fn update_clustered(&mut self, lights: &[(LightId, &Light)])
Update clustered light assignment with current lights.
Sourcepub fn update_light_shaft_position(
&mut self,
light_world_pos: Vec3,
view_projection: &Mat4,
)
pub fn update_light_shaft_position( &mut self, light_world_pos: Vec3, view_projection: &Mat4, )
Update the light shaft screen position.
Sourcepub fn tiled_stats(&self) -> Option<TiledCullingStats>
pub fn tiled_stats(&self) -> Option<TiledCullingStats>
Get tiled culling stats.
Sourcepub fn clustered_stats(&self) -> Option<ClusteredStats>
pub fn clustered_stats(&self) -> Option<ClusteredStats>
Get clustered stats.
Trait Implementations§
Source§impl Debug for VolumetricSystem
impl Debug for VolumetricSystem
Auto Trait Implementations§
impl Freeze for VolumetricSystem
impl RefUnwindSafe for VolumetricSystem
impl Send for VolumetricSystem
impl Sync for VolumetricSystem
impl Unpin for VolumetricSystem
impl UnsafeUnpin for VolumetricSystem
impl UnwindSafe for VolumetricSystem
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> 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.