#include <cooktorrance.h>
Public Member Functions | |
CookTorrance (const SWCSpectrum &ks, MicrofacetDistribution *dist, Fresnel *fres) | |
virtual | ~CookTorrance () |
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 &wi, Vector *sampled_f, float u1, float u2, SWCSpectrum *const f, float *pdf, float *pdfBack=NULL, bool reverse=false) const |
virtual float | Pdf (const TsPack *tspack, const Vector &wi, const Vector &wo) const |
Private Attributes | |
const SWCSpectrum | KS |
MicrofacetDistribution * | distribution |
Fresnel * | fresnel |
Definition at line 34 of file cooktorrance.h.
CookTorrance::CookTorrance | ( | const SWCSpectrum & | ks, | |
MicrofacetDistribution * | dist, | |||
Fresnel * | fres | |||
) |
Definition at line 32 of file cooktorrance.cpp.
virtual lux::CookTorrance::~CookTorrance | ( | ) | [inline, virtual] |
Definition at line 38 of file cooktorrance.h.
void CookTorrance::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 37 of file cooktorrance.cpp.
References lux::SWCSpectrum::AddWeighted(), lux::CosTheta(), lux::MicrofacetDistribution::D(), distribution, lux::Dot(), lux::Fresnel::Evaluate(), fresnel, G(), KS, M_PI, and lux::Normalize().
Referenced by G(), and Sample_f().
Definition at line 49 of file cooktorrance.cpp.
References lux::AbsDot(), lux::CosTheta(), f(), and cimg_library::cimg::min().
Referenced by f().
float CookTorrance::Pdf | ( | const TsPack * | tspack, | |
const Vector & | wi, | |||
const Vector & | wo | |||
) | const [virtual] |
Reimplemented from lux::BxDF.
Definition at line 77 of file cooktorrance.cpp.
References distribution, lux::MicrofacetDistribution::Pdf(), and lux::SameHemisphere().
Referenced by Sample_f().
bool CookTorrance::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 58 of file cooktorrance.cpp.
References distribution, f(), Pdf(), and lux::MicrofacetDistribution::Sample_f().
Definition at line 46 of file cooktorrance.h.
Referenced by f(), Pdf(), and Sample_f().
Fresnel* lux::CookTorrance::fresnel [private] |
Definition at line 47 of file cooktorrance.h.
Referenced by f().
const SWCSpectrum lux::CookTorrance::KS [private] |
Definition at line 45 of file cooktorrance.h.
Referenced by f().