pub struct LightProbeGrid3D { /* private fields */ }Expand description
Regular 3D grid of L2 Spherical Harmonics irradiance probes supporting trilinear interpolation, normal bias, and automated baking.
Implementations§
Source§impl LightProbeGrid3D
3D regular lattice management, SH9 probe baking, and trilinear normal-biased sampling for LightProbeGrid3D.
impl LightProbeGrid3D
3D regular lattice management, SH9 probe baking, and trilinear normal-biased sampling for LightProbeGrid3D.
Sourcepub fn new(bounds: AxisAlignedBox3D, dims: [usize; 3], normal_bias: f32) -> Self
pub fn new(bounds: AxisAlignedBox3D, dims: [usize; 3], normal_bias: f32) -> Self
Creates a pre-allocated regular 3D LightProbeGrid3D spanning bounds with dimensions dims = [nx, ny, nz].
§Arguments
AxisAlignedBox3D- World-space probe volume bounds.[usize; 3]- Grid resolution[nx, ny, nz](each clamped>= 1).f32- Surface normal bias offset in meters (>= 0.0).
§Returns
Self- Zero-initialized light probe grid.
Sourcepub fn set_probe_at(
&mut self,
ix: usize,
iy: usize,
iz: usize,
probe: Sh9Probe3D,
)
pub fn set_probe_at( &mut self, ix: usize, iy: usize, iz: usize, probe: Sh9Probe3D, )
Overwrites the stored Sh9Probe3D at lattice index (ix, iy, iz).
§Arguments
usize- Grid X index.usize- Grid Y index.usize- Grid Z index.Sh9Probe3D- New SH9 probe coefficients.
Sourcepub fn bake_from_rig_and_sky(
&mut self,
rig: &LightRig3D,
sky: &PhysicalSky3D,
sun_dir: Vec3,
sky_samples: u32,
)
pub fn bake_from_rig_and_sky( &mut self, rig: &LightRig3D, sky: &PhysicalSky3D, sun_dir: Vec3, sky_samples: u32, )
Automatically bakes every probe in the 3D grid from LightRig3D and PhysicalSky3D into L2 Spherical Harmonics.
§Arguments
&LightRig3D- Scene lighting rig (directional, point, spot, and area lights).&PhysicalSky3D- Physical atmospheric sky dome.Vec3- Unit sun direction for sky evaluation.u32- Sky-dome Hammersley sphere sample count (0uses default128).
Sourcepub fn sample_irradiance(&self, world_pos: Vec3, normal: Vec3) -> Vec3
pub fn sample_irradiance(&self, world_pos: Vec3, normal: Vec3) -> Vec3
Source§impl LightProbeGrid3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl LightProbeGrid3D
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_bounds(&self) -> AxisAlignedBox3D
pub fn get_mut_bounds(&mut self) -> &mut AxisAlignedBox3D
pub fn set_bounds(&mut self, val: AxisAlignedBox3D) -> &mut Self
pub fn get_dims(&self) -> [usize; 3]
pub fn get_mut_dims(&mut self) -> &mut [usize; 3]
pub fn set_dims(&mut self, val: [usize; 3]) -> &mut Self
pub fn get_normal_bias(&self) -> f32
pub fn get_mut_normal_bias(&mut self) -> &mut f32
pub fn set_normal_bias(&mut self, val: f32) -> &mut Self
pub fn get_probes(&self) -> &Vec<Sh9Probe3D>
pub fn get_mut_probes(&mut self) -> &mut Vec<Sh9Probe3D>
pub fn set_probes(&mut self, val: Vec<Sh9Probe3D>) -> &mut Self
Trait Implementations§
Source§impl Clone for LightProbeGrid3D
impl Clone for LightProbeGrid3D
Source§impl Debug for LightProbeGrid3D
impl Debug for LightProbeGrid3D
Source§impl PartialEq for LightProbeGrid3D
impl PartialEq for LightProbeGrid3D
impl StructuralPartialEq for LightProbeGrid3D
Auto Trait Implementations§
impl Forget for LightProbeGrid3D
impl Freeze for LightProbeGrid3D
impl Move for LightProbeGrid3D
impl RefUnwindSafe for LightProbeGrid3D
impl Send for LightProbeGrid3Dwhere
RawVecInner: Send,
impl Sync for LightProbeGrid3Dwhere
RawVecInner: Sync,
impl Unpin for LightProbeGrid3D
impl UnsafeUnpin for LightProbeGrid3D
impl UnwindSafe for LightProbeGrid3Dwhere
RawVecInner: UnwindSafe,
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