[][src]Trait tray_rust::light::Light

pub trait Light {
    fn sample_incident(
        &self,
        p: &Point,
        samples: &(f32, f32),
        time: f32
    ) -> (Colorf, Vector, f32, OcclusionTester);
fn delta_light(&self) -> bool;
fn pdf(&self, p: &Point, w_i: &Vector, time: f32) -> f32; }

Trait implemented by all lights in tray_rust. Provides methods for sampling the light and in the future ones for checking if it's a delta light, computing its power and so on.

Required methods

fn sample_incident(
    &self,
    p: &Point,
    samples: &(f32, f32),
    time: f32
) -> (Colorf, Vector, f32, OcclusionTester)

Sample the illumination from the light arriving at the point p Returns the color, incident light direction, pdf and occlusion tester object samples will be used to randomly sample the light.

fn delta_light(&self) -> bool

Determine if the light is described by a delta distribution

fn pdf(&self, p: &Point, w_i: &Vector, time: f32) -> f32

Compute the PDF for sampling the point with incident direction w_i

Loading content...

Implementors

impl Light for Emitter[src]

Loading content...