#include <microfacet.h>
Public Member Functions | |
Microfacet (const SWCSpectrum &reflectance, Fresnel *f, MicrofacetDistribution *d) | |
virtual | ~Microfacet () |
virtual void | f (const TsPack *tspack, const Vector &wo, const Vector &wi, SWCSpectrum *const f) const |
float | G (const Vector &wo, const Vector &wi, const Vector &wh) const |
virtual bool | Sample_f (const TsPack *tspack, const Vector &wo, Vector *wi, float u1, float u2, SWCSpectrum *const f, float *pdf, float *pdfBack=NULL, bool reverse=false) const |
virtual float | Pdf (const TsPack *tspack, const Vector &wo, const Vector &wi) const |
Private Attributes | |
SWCSpectrum | R |
MicrofacetDistribution * | distribution |
Fresnel * | fresnel |
Definition at line 33 of file microfacet.h.
Microfacet::Microfacet | ( | const SWCSpectrum & | reflectance, | |
Fresnel * | f, | |||
MicrofacetDistribution * | d | |||
) |
Definition at line 32 of file microfacet.cpp.
virtual lux::Microfacet::~Microfacet | ( | ) | [inline, virtual] |
Definition at line 38 of file microfacet.h.
void Microfacet::f | ( | const TsPack * | tspack, | |
const Vector & | wo, | |||
const Vector & | wi, | |||
SWCSpectrum *const | f | |||
) | const [virtual] |
Evaluates the BxDF. Accumulates the result in the f parameter.
Implements lux::BxDF.
Definition at line 40 of file microfacet.cpp.
References lux::SWCSpectrum::AddWeighted(), lux::CosTheta(), lux::MicrofacetDistribution::D(), distribution, lux::Dot(), lux::Fresnel::Evaluate(), fresnel, G(), lux::Normalize(), and R.
Referenced by Sample_f().
Definition at line 40 of file microfacet.h.
References lux::AbsDot(), lux::CosTheta(), and cimg_library::cimg::min().
Referenced by f().
float Microfacet::Pdf | ( | const TsPack * | tspack, | |
const Vector & | wo, | |||
const Vector & | wi | |||
) | const [virtual] |
Reimplemented from lux::BxDF.
Definition at line 70 of file microfacet.cpp.
References distribution, lux::MicrofacetDistribution::Pdf(), and lux::SameHemisphere().
Referenced by Sample_f().
bool Microfacet::Sample_f | ( | const TsPack * | tspack, | |
const Vector & | wo, | |||
Vector * | wi, | |||
float | u1, | |||
float | u2, | |||
SWCSpectrum *const | f, | |||
float * | pdf, | |||
float * | pdfBack = NULL , |
|||
bool | reverse = false | |||
) | const [virtual] |
Samples the BxDF. Returns the result of the BxDF for the sampled direction in f.
Reimplemented from lux::BxDF.
Definition at line 53 of file microfacet.cpp.
References distribution, f(), Pdf(), lux::SameHemisphere(), and lux::MicrofacetDistribution::Sample_f().
Definition at line 56 of file microfacet.h.
Referenced by f(), Pdf(), and Sample_f().
Fresnel* lux::Microfacet::fresnel [private] |
Definition at line 57 of file microfacet.h.
Referenced by f().
SWCSpectrum lux::Microfacet::R [private] |
Definition at line 55 of file microfacet.h.
Referenced by f().