pub fn sample_f(
        &self,
        wo: &Vector3f,
        wi: &mut Vector3f,
        u: &Point2f,
        pdf: &mut Float,
        sampled_type: &mut u8,
    ) -> Spectrum {
        match self {
            Bxdf::Empty(_bxdf) => Spectrum::default(),
            Bxdf::SpecRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::SpecTrans(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::FresnelSpec(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::LambertianRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::LambertianTrans(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::OrenNayarRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::MicrofacetRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::MicrofacetTrans(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::FresnelBlnd(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::Fourier(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::Bssrdf(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisDiff(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisSS(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisRetro(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisSheen(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisClearCoat(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::Hair(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
        }
    }
/// Sample the BxDF for the given outgoing direction, using the given pair of uniform samples.
///
/// The default implementation uses importance sampling by using a cosine-weighted
/// distribution.
Sample the BxDF for the given outgoing direction, using the given pair of uniform samples.
The default implementation uses importance sampling by using a cosine-weighted
distribution.
Sample the BxDF for the given outgoing direction using the given pair of uniform samples . The default implementation uses importance sampling by using a cosine - weighted distribution .
pub fn sample_f(
        &self,
        wo: &Vector3f,
        wi: &mut Vector3f,
        u: &Point2f,
        pdf: &mut Float,
        sampled_type: &mut u8,
    ) -> Spectrum {
        match self {
            Bxdf::Empty(_bxdf) => Spectrum::default(),
            Bxdf::SpecRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::SpecTrans(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::FresnelSpec(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::LambertianRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::LambertianTrans(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::OrenNayarRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::MicrofacetRefl(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::MicrofacetTrans(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::FresnelBlnd(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::Fourier(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::Bssrdf(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisDiff(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisSS(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisRetro(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisSheen(_bxdf) => self.default_sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::DisClearCoat(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
            Bxdf::Hair(bxdf) => bxdf.sample_f(wo, wi, u, pdf, sampled_type),
        }
    }
pub fn sample_f ( & self , wo : & Vector3f , wi : & mut Vector3f , u : & Point2f , pdf : & mut Float , sampled_type : & mut u8 , ) -> Spectrum { match self { Bxdf :: Empty ( _bxdf ) => Spectrum :: default ( ) , Bxdf :: SpecRefl ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: SpecTrans ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: FresnelSpec ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: LambertianRefl ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: LambertianTrans ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: OrenNayarRefl ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: MicrofacetRefl ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: MicrofacetTrans ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: FresnelBlnd ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: Fourier ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: Bssrdf ( _bxdf ) => self . default_sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: DisDiff ( _bxdf ) => self . default_sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: DisSS ( _bxdf ) => self . default_sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: DisRetro ( _bxdf ) => self . default_sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: DisSheen ( _bxdf ) => self . default_sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: DisClearCoat ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , Bxdf :: Hair ( bxdf ) => bxdf . sample_f ( wo , wi , u , pdf , sampled_type ) , } }
Sample the BxDF for the given outgoing direction, using the given pair of uniform samples.
Sample the BxDF for the given outgoing direction using the given pair of uniform samples .
&self
wo
&Vector3f
wi
&mut Vector3f
u
&Point2f
pdf
&mut Float
sampled_type
&mut u8