[][src]Trait pbrt::core::light::Light

pub trait Light {
    fn sample_li(
        &self,
        iref: &InteractionCommon,
        u: &Point2f,
        wi: &mut Vector3f,
        pdf: &mut Float,
        vis: &mut VisibilityTester
    ) -> Spectrum;
fn power(&self) -> Spectrum;
fn preprocess(&self, scene: &Scene);
fn le(&self, _ray: &mut Ray) -> Spectrum;
fn pdf_li(&self, iref: &dyn Interaction, wi: Vector3f) -> Float;
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;
fn pdf_le(
        &self,
        ray: &Ray,
        n_light: &Normal3f,
        pdf_pos: &mut Float,
        pdf_dir: &mut Float
    );
fn get_flags(&self) -> u8;
fn get_n_samples(&self) -> i32; }

Required Methods

Returns the radiance arriving at a point at a certain time due to the light, assuming there are no occluding objects between them.

Implementors

impl Light for DiffuseAreaLight
[src]

impl Light for DistantLight
[src]

Some of the DistanceLight methods need to know the bounds of the scene. Because lights are created before the scene geometry, these bounds aren't available when the DistanceLight constructor runs. Therefore, DistanceLight implements the optional preprocess() method to get the bound. This method is called at the end of the Scene constructor.

Default implementation returns no emitted radiance for a ray that escapes the scene bounds.

impl Light for InfiniteAreaLight
[src]

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.

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.

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.

impl Light for PointLight
[src]

Default implementation returns no emitted radiance for a ray that escapes the scene bounds.

impl Light for SpotLight
[src]

Default implementation returns no emitted radiance for a ray that escapes the scene bounds.