Trait arendur::lighting::Light [] [src]

pub trait Light: Sync + Send {
    fn flags(&self) -> LightFlag;
    fn evaluate_sampled(&self, pos: Point3f, sample: Point2f) -> LightSample;
    fn generate_path(&self, samples: SampleInfo) -> PathInfo;
    fn pdf_path(
        &self,
        pos: Point3f,
        dir: Vector3f,
        normal: Vector3f
    ) -> (Float, Float); fn power(&self) -> RGBSpectrumf; fn is_delta(&self) -> bool { ... } fn evaluate_ray(&self, rd: &RayDifferential) -> RGBSpectrumf { ... } fn evaluate_path(&self, _pos: Point3f, _dir: Vector3f) -> RGBSpectrumf { ... } fn pdf(&self, _pos: Point3f, _wi: Vector3f) -> Float { ... } fn preprocess(&mut self, _s: &Scene) { ... } }

A Light

Required Methods

return the flags of the light

Given a pos in local frame with a uniform sample in $[0, 1)$, sample an incoming direction from the light to that location, returns the sampling result in a LightSample.

Generate a photon path from the light source based on the sample info

Given position and direction of a photon path, and the light's normal return its pdfs as (pdfpos, pdfdir)

returns an estimation of total power of this light

Provided Methods

test if the light has delta distribution

Given a position and an incoming direction in local coordinates, evaluate the light's radiance along that direction. This method takes an RayDifferential because some light implementations might found thouse differentials helpful.

Default implementation yields zero radiance

Given a position on surface and an direction in local coordinates, evaluate the light's emitted radiance along that direction.

Default implementation yields zero radiance

Given a position and lighting ray wi of an interaction, return the pdf of it

preporcess with scene components, if necessary. renderers should respect this requirement.

Default implementation is noop.

Implementors