pub struct LightBaker {
pub sample_count: u32,
pub hemisphere_samples: Vec<Vec3>,
}Expand description
CPU-side light baking utility.
Casts shadow rays and computes irradiance at sample points, storing
results in a LightMap for static illumination.
Fields§
§sample_count: u32§hemisphere_samples: Vec<Vec3>Implementations§
Source§impl LightBaker
impl LightBaker
pub fn new(sample_count: u32) -> Self
Sourcepub fn bake_point_ibl(
&self,
position: Vec3,
normal: Vec3,
env: &IblEnvironment,
) -> Vec3
pub fn bake_point_ibl( &self, position: Vec3, normal: Vec3, env: &IblEnvironment, ) -> Vec3
Bake indirect irradiance at a sample point from the sky environment.
Sourcepub fn bake_point_direct(
&self,
position: Vec3,
normal: Vec3,
manager: &LightManager,
) -> Vec3
pub fn bake_point_direct( &self, position: Vec3, normal: Vec3, manager: &LightManager, ) -> Vec3
Bake direct irradiance from all active lights (no shadow ray casting).
Sourcepub fn bake_samples(
&self,
samples: &[(Vec3, Vec3)],
manager: &LightManager,
env: &IblEnvironment,
) -> Vec<Vec3>
pub fn bake_samples( &self, samples: &[(Vec3, Vec3)], manager: &LightManager, env: &IblEnvironment, ) -> Vec<Vec3>
Full bake: direct + IBL for a set of sample points.
Sourcepub fn bake_plane(
&self,
width: u32,
height: u32,
origin: Vec3,
u_axis: Vec3,
v_axis: Vec3,
normal: Vec3,
manager: &LightManager,
env: &IblEnvironment,
) -> LightMap
pub fn bake_plane( &self, width: u32, height: u32, origin: Vec3, u_axis: Vec3, v_axis: Vec3, normal: Vec3, manager: &LightManager, env: &IblEnvironment, ) -> LightMap
Bake a 2D lightmap for a planar surface.
Auto Trait Implementations§
impl Freeze for LightBaker
impl RefUnwindSafe for LightBaker
impl Send for LightBaker
impl Sync for LightBaker
impl Unpin for LightBaker
impl UnsafeUnpin for LightBaker
impl UnwindSafe for LightBaker
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.