[][src]Trait tray_rust::bxdf::BxDF

pub trait BxDF {
    fn bxdf_type(&self) -> EnumSet<BxDFType>;
fn eval(&self, w_o: &Vector, w_i: &Vector) -> Colorf; fn sample(
        &self,
        w_o: &Vector,
        samples: &(f32, f32)
    ) -> (Colorf, Vector, f32) { ... }
fn matches(&self, flags: EnumSet<BxDFType>) -> bool { ... }
fn pdf(&self, w_o: &Vector, w_i: &Vector) -> f32 { ... } }

Trait implemented by BRDF/BTDFs in tray_rust. Provides methods for evaluating and sampling the function

Required methods

fn bxdf_type(&self) -> EnumSet<BxDFType>

Get the type of this BxDF

fn eval(&self, w_o: &Vector, w_i: &Vector) -> Colorf

Evaluate the BxDF for the pair of incident and outgoing light directions, w_i and w_o.

Loading content...

Provided methods

fn sample(&self, w_o: &Vector, samples: &(f32, f32)) -> (Colorf, Vector, f32)

Sample an incident light direction for an outgoing light direction w_o. samples will be used to randomly sample a direction for the outgoing light Returns the color of the material for the pair of directions, the incident light direction and pdf

fn matches(&self, flags: EnumSet<BxDFType>) -> bool

Check if this BxDF matches the type flags passed

fn pdf(&self, w_o: &Vector, w_i: &Vector) -> f32

Compute the pdf of sampling the pair of directions passed for this BxDF

Loading content...

Implementors

impl BxDF for Lambertian[src]

impl BxDF for OrenNayar[src]

impl<'a> BxDF for Merl<'a>[src]

impl<'a> BxDF for MicrofacetTransmission<'a>[src]

impl<'a> BxDF for SpecularReflection<'a>[src]

fn eval(&self, _: &Vector, _: &Vector) -> Colorf[src]

We'll never exactly hit the specular reflection direction with some pair so this just returns black. Use sample instead

fn sample(&self, w_o: &Vector, _: &(f32, f32)) -> (Colorf, Vector, f32)[src]

Sampling the specular BRDF just returns the specular reflection direction for the light leaving along w_o

impl<'a> BxDF for SpecularTransmission<'a>[src]

fn eval(&self, _: &Vector, _: &Vector) -> Colorf[src]

We'll never exactly hit the specular transmission direction with some pair so this just returns black. Use sample instead

fn sample(&self, w_o: &Vector, _: &(f32, f32)) -> (Colorf, Vector, f32)[src]

Sampling the specular BTDF just returns the specular transmission direction for the light leaving along w_o

impl<'a> BxDF for TorranceSparrow<'a>[src]

Loading content...