pub struct SvogiSystem {
pub octree: SparseVoxelOctree,
pub atlas: BrickAtlas,
pub config: SvogiConfig,
/* private fields */
}Expand description
The main SVOGI system integrating all components.
Fields§
§octree: SparseVoxelOctree§atlas: BrickAtlas§config: SvogiConfigImplementations§
Source§impl SvogiSystem
impl SvogiSystem
Sourcepub fn init(world_bounds: Aabb, config: SvogiConfig) -> Self
pub fn init(world_bounds: Aabb, config: SvogiConfig) -> Self
Initialize the SVOGI system.
Sourcepub fn voxelize_scene(&mut self, scene_triangles: &[Triangle])
pub fn voxelize_scene(&mut self, scene_triangles: &[Triangle])
Voxelize a scene from triangles.
Sourcepub fn inject_lights(
&mut self,
lights: &[LightSource],
shadow_maps: &[ShadowMap],
)
pub fn inject_lights( &mut self, lights: &[LightSource], shadow_maps: &[ShadowMap], )
Inject direct lighting from light sources and shadow maps.
Sourcepub fn propagate(&mut self, iterations: u32)
pub fn propagate(&mut self, iterations: u32)
Propagate light for the given number of iterations.
Sourcepub fn apply_gi(
&self,
gbuffer_positions: &[Vec3],
gbuffer_normals: &[Vec3],
gbuffer_albedo: &[Vec3],
) -> Vec<Vec4>
pub fn apply_gi( &self, gbuffer_positions: &[Vec3], gbuffer_normals: &[Vec3], gbuffer_albedo: &[Vec3], ) -> Vec<Vec4>
Compute per-pixel GI from G-buffer data.
Sourcepub fn update(
&mut self,
dt: f32,
scene_triangles: &[Triangle],
lights: &[LightSource],
shadow_maps: &[ShadowMap],
)
pub fn update( &mut self, dt: f32, scene_triangles: &[Triangle], lights: &[LightSource], shadow_maps: &[ShadowMap], )
Full frame update: voxelize if needed, inject, propagate.
Sourcepub fn mark_dirty(&mut self, region: Aabb)
pub fn mark_dirty(&mut self, region: Aabb)
Mark a region as dirty for incremental updates.
Sourcepub fn render_debug(
&self,
view: SvogiDebugView,
camera_pos: Vec3,
) -> Vec<(Vec3, Vec4)>
pub fn render_debug( &self, view: SvogiDebugView, camera_pos: Vec3, ) -> Vec<(Vec3, Vec4)>
Render debug visualization.
Sourcepub fn stats(&self) -> SvogiStats
pub fn stats(&self) -> SvogiStats
Get statistics.
Auto Trait Implementations§
impl Freeze for SvogiSystem
impl RefUnwindSafe for SvogiSystem
impl Send for SvogiSystem
impl Sync for SvogiSystem
impl Unpin for SvogiSystem
impl UnsafeUnpin for SvogiSystem
impl UnwindSafe for SvogiSystem
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> 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.