Struct rs_pbrt::core::lightdistrib::SpatialLightDistribution
source · [−]pub struct SpatialLightDistribution {
pub scene: Scene,
pub n_voxels: [i32; 3],
pub hash_table_size: usize,
/* private fields */
}
Expand description
A spatially-varying light distribution that adjusts the probability of sampling a light source based on an estimate of its contribution to a region of space. A fixed voxel grid is imposed over the scene bounds and a sampling distribution is computed as needed for each voxel.
Fields
scene: Scene
n_voxels: [i32; 3]
hash_table_size: usize
Implementations
sourceimpl SpatialLightDistribution
impl SpatialLightDistribution
pub fn new(scene: &Scene, max_voxels: u32) -> Self
sourcepub fn compute_distribution(&self, pi: &Point3i) -> Distribution1D
pub fn compute_distribution(&self, pi: &Point3i) -> Distribution1D
Compute the sampling distribution for the voxel with integer coordiantes given by “pi”.
sourcepub fn lookup(&self, p: &Point3f) -> Arc<Distribution1D>
pub fn lookup(&self, p: &Point3f) -> Arc<Distribution1D>
Given a point |p| in space, this method returns a (hopefully effective) sampling distribution for light sources at that point.
Auto Trait Implementations
impl !RefUnwindSafe for SpatialLightDistribution
impl Send for SpatialLightDistribution
impl Sync for SpatialLightDistribution
impl Unpin for SpatialLightDistribution
impl !UnwindSafe for SpatialLightDistribution
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more