Trait arendur::bxdf::microfacet::MicrofacetDistribution
[−]
[src]
pub trait MicrofacetDistribution { fn distribution(&self, wh: Vector3f) -> Float; fn lambda(&self, w: Vector3f) -> Float; fn sample_wh(&self, wo: Vector3f, u: Point2f) -> Vector3f; fn visible(&self, w: Vector3f) -> Float { ... } fn visible_both(&self, w0: Vector3f, w1: Vector3f) -> Float { ... } fn pdf(&self, wo: Vector3f, wh: Vector3f) -> Float { ... } }
A microfacet distribution description
Required Methods
fn distribution(&self, wh: Vector3f) -> Float
Given the macro surface normal wh
, returns the differential
area of microfacets from that angle
A physically plausible microfacet distribution $D$ should be normalized, s.t. $\integral_{H2(n)}D(\omega_h)cos\theta_h d\omega_h=1$
fn lambda(&self, w: Vector3f) -> Float
Given a direction w
, return masked prjected surface area
per visible projected surface area along that direction,
assuming this value is independent from wh
.
fn sample_wh(&self, wo: Vector3f, u: Point2f) -> Vector3f
given a uniform sample, return a sampled macro normal wh
Provided Methods
fn visible(&self, w: Vector3f) -> Float
fraction of facets visible from w
.
The masking-shadowing function $G_l$
This interface assumes independence from wh
fn visible_both(&self, w0: Vector3f, w1: Vector3f) -> Float
fraction of facets visible from both w0
and w1
This interface assumes independence from wh
fn pdf(&self, wo: Vector3f, wh: Vector3f) -> Float
given wo
and a sampled wh
, returns the pdf of this sample
Implementors
impl MicrofacetDistribution for Beckmann
impl MicrofacetDistribution for Trowbridge