[][src]Trait tray_rust::integrator::Integrator

pub trait Integrator {
    fn illumination(
        &self,
        scene: &Scene,
        light_list: &[&Emitter],
        ray: &Ray,
        hit: &Intersection,
        sampler: &mut dyn Sampler,
        rng: &mut StdRng,
        alloc: &Allocator
    ) -> Colorf; fn specular_reflection(
        &self,
        scene: &Scene,
        light_list: &[&Emitter],
        ray: &Ray,
        bsdf: &BSDF,
        sampler: &mut dyn Sampler,
        rng: &mut StdRng,
        alloc: &Allocator
    ) -> Colorf { ... }
fn specular_transmission(
        &self,
        scene: &Scene,
        light_list: &[&Emitter],
        ray: &Ray,
        bsdf: &BSDF,
        sampler: &mut dyn Sampler,
        rng: &mut StdRng,
        alloc: &Allocator
    ) -> Colorf { ... }
fn sample_one_light(
        &self,
        scene: &Scene,
        light_list: &[&Emitter],
        w_o: &Vector,
        p: &Point,
        bsdf: &BSDF,
        light_sample: &Sample,
        bsdf_sample: &Sample,
        time: f32
    ) -> Colorf { ... }
fn estimate_direct(
        &self,
        scene: &Scene,
        w_o: &Vector,
        p: &Point,
        bsdf: &BSDF,
        light_sample: &Sample,
        bsdf_sample: &Sample,
        light: &dyn Light,
        flags: EnumSet<BxDFType>,
        time: f32
    ) -> Colorf { ... } }

Trait implemented by the various integration methods that can be used to render the scene. For scene usage information see whitted and path to get information on how to specify them.

Required methods

fn illumination(
    &self,
    scene: &Scene,
    light_list: &[&Emitter],
    ray: &Ray,
    hit: &Intersection,
    sampler: &mut dyn Sampler,
    rng: &mut StdRng,
    alloc: &Allocator
) -> Colorf

Compute the illumination at the intersection in the scene

Loading content...

Provided methods

fn specular_reflection(
    &self,
    scene: &Scene,
    light_list: &[&Emitter],
    ray: &Ray,
    bsdf: &BSDF,
    sampler: &mut dyn Sampler,
    rng: &mut StdRng,
    alloc: &Allocator
) -> Colorf

Compute the color of specularly reflecting light off the intersection

fn specular_transmission(
    &self,
    scene: &Scene,
    light_list: &[&Emitter],
    ray: &Ray,
    bsdf: &BSDF,
    sampler: &mut dyn Sampler,
    rng: &mut StdRng,
    alloc: &Allocator
) -> Colorf

Compute the color of specularly transmitted light through the intersection

fn sample_one_light(
    &self,
    scene: &Scene,
    light_list: &[&Emitter],
    w_o: &Vector,
    p: &Point,
    bsdf: &BSDF,
    light_sample: &Sample,
    bsdf_sample: &Sample,
    time: f32
) -> Colorf

Uniformly sample the contribution of a randomly chosen light in the scene to the illumination of this BSDF at the point

  • w_o outgoing direction of the light that is incident from the light being sampled and reflecting off the surface
  • bsdf surface properties of the surface being illuminated
  • light_sample 3 random samples for the light
  • bsdf_sample 3 random samples for the bsdf

fn estimate_direct(
    &self,
    scene: &Scene,
    w_o: &Vector,
    p: &Point,
    bsdf: &BSDF,
    light_sample: &Sample,
    bsdf_sample: &Sample,
    light: &dyn Light,
    flags: EnumSet<BxDFType>,
    time: f32
) -> Colorf

Estimate the direct light contribution to the surface being shaded by the light using multiple importance sampling

  • w_o outgoing direction of the light that is incident from the light being sampled and reflecting off the surface
  • bsdf surface properties of the surface being illuminated
  • light_sample 3 random samples for the light
  • bsdf_sample 3 random samples for the bsdf
  • light light to sample contribution from
  • flags flags for which BxDF types to sample
Loading content...

Implementors

impl Integrator for NormalsDebug[src]

impl Integrator for Path[src]

impl Integrator for Whitted[src]

Loading content...