pub struct InfiniteAreaLight {
pub lmap: Arc<MipMap<Spectrum>>,
pub world_center: RwLock<Point3f>,
pub world_radius: RwLock<Float>,
pub distribution: Arc<Distribution2D>,
pub flags: u8,
pub n_samples: i32,
pub medium_interface: MediumInterface,
pub light_to_world: Transform,
pub world_to_light: Transform,
}
Fields
lmap: Arc<MipMap<Spectrum>>
world_center: RwLock<Point3f>
world_radius: RwLock<Float>
distribution: Arc<Distribution2D>
flags: u8
n_samples: i32
medium_interface: MediumInterface
light_to_world: Transform
world_to_light: Transform
Implementations
sourceimpl InfiniteAreaLight
impl InfiniteAreaLight
pub fn new(
light_to_world: &Transform,
l: &Spectrum,
n_samples: i32,
texmap: String
) -> Self
pub fn new_hdr(
light_to_world: &Transform,
l: &Spectrum,
n_samples: i32,
texmap: String
) -> Self
pub fn sample_li<'a, 'b>(
&'b self,
iref: &'a InteractionCommon,
light_intr: &'b mut InteractionCommon,
u: Point2f,
wi: &mut Vector3f,
pdf: &mut Float,
vis: &mut VisibilityTester<'a, 'b>
) -> Spectrum
sourcepub fn power(&self) -> Spectrum
pub fn power(&self) -> Spectrum
Like directional lights, the total power from the infinite area light is related to the surface area of the scene. Like many other lights the power computed here is approximate.
sourcepub fn preprocess(&self, scene: &Scene)
pub fn preprocess(&self, scene: &Scene)
Like DistanceLights, InfiniteAreaLights also need the scene bounds; here again, the preprocess() method finds the scene bounds after all of the scene geometry has been created.
sourcepub fn le(&self, ray: &Ray) -> Spectrum
pub fn le(&self, ray: &Ray) -> Spectrum
Because infinte area lights need to be able to contribute radiance to rays that don’t hit any geometry in the scene, we’ll add a method to the base Light class that returns emitted radiance due to that light along a ray that escapes the scene bounds. It’s the responsibility of the integrators to call this method for these rays.
pub fn pdf_li(&self, _iref: &dyn Interaction, w: &Vector3f) -> Float
pub fn sample_le(
&self,
u1: Point2f,
u2: Point2f,
time: Float,
ray: &mut Ray,
n_light: &mut Normal3f,
pdf_pos: &mut Float,
pdf_dir: &mut Float
) -> Spectrum
pub fn pdf_le(
&self,
ray: &Ray,
_n_light: &Normal3f,
pdf_pos: &mut Float,
pdf_dir: &mut Float
)
pub fn get_flags(&self) -> u8
pub fn get_n_samples(&self) -> i32
Auto Trait Implementations
impl RefUnwindSafe for InfiniteAreaLight
impl Send for InfiniteAreaLight
impl Sync for InfiniteAreaLight
impl Unpin for InfiniteAreaLight
impl UnwindSafe for InfiniteAreaLight
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