[][src]Trait tray_rust::bxdf::microfacet::MicrofacetDistribution

pub trait MicrofacetDistribution {
    fn normal_distribution(&self, w_h: &Vector) -> f32;
fn sample(&self, w_o: &Vector, samples: &(f32, f32)) -> Vector;
fn pdf(&self, w_h: &Vector) -> f32;
fn shadowing_masking(&self, w_i: &Vector, w_o: &Vector, w_h: &Vector) -> f32;
fn monodir_shadowing(&self, v: &Vector, w_h: &Vector) -> f32; }

Trait implemented by all microfacet distributions

Required methods

fn normal_distribution(&self, w_h: &Vector) -> f32

Compute the probability that microfacets are oriented with normal w_h in this distribution

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

Sample the distribution for some outgoing light direction w_o. returns the sampled microfacet normal

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

Compute the probability of sampling a certain microfacet normal from the distribution, w_h

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

Compute the shadowing masking function for the incident and outgoing directions w_i and w_o for microfacets with normal w_h. Returns what fraction of the microfacets with the normal are visible in both directions.

fn monodir_shadowing(&self, v: &Vector, w_h: &Vector) -> f32

Return the monodirectional shadowing function, G_1 v is the reflected/incident direction, w_h is the microfacet normal

Loading content...

Implementors

impl MicrofacetDistribution for Beckmann[src]

fn monodir_shadowing(&self, v: &Vector, w_h: &Vector) -> f32[src]

Monodirectional shadowing function from Walter et al., we use the Smith shadowing-masking which uses the reciprocity of this function. w is the incident/outgoing light direction and w_h is the microfacet normal

impl MicrofacetDistribution for GGX[src]

fn monodir_shadowing(&self, v: &Vector, w_h: &Vector) -> f32[src]

Monodirectional shadowing function from Walter et al., we use the Smith shadowing-masking which uses the reciprocity of this function. w is the incident/outgoing light direction and w_h is the microfacet normal

Loading content...