#include <fresnelblend.h>
Public Member Functions | |
FresnelBlend (const SWCSpectrum &Rd, const SWCSpectrum &Rs, const SWCSpectrum &Alpha, float d, MicrofacetDistribution *dist) | |
virtual | ~FresnelBlend () |
virtual void | f (const TsPack *tspack, const Vector &wo, const Vector &wi, SWCSpectrum *const f) const |
SWCSpectrum | SchlickFresnel (float costheta) 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 &wi, const Vector &wo) const |
Private Attributes | |
SWCSpectrum | Rd |
SWCSpectrum | Rs |
SWCSpectrum | Alpha |
float | depth |
MicrofacetDistribution * | distribution |
Definition at line 33 of file fresnelblend.h.
FresnelBlend::FresnelBlend | ( | const SWCSpectrum & | Rd, | |
const SWCSpectrum & | Rs, | |||
const SWCSpectrum & | Alpha, | |||
float | d, | |||
MicrofacetDistribution * | dist | |||
) |
Definition at line 31 of file fresnelblend.cpp.
References distribution.
virtual lux::FresnelBlend::~FresnelBlend | ( | ) | [inline, virtual] |
Definition at line 42 of file fresnelblend.h.
void FresnelBlend::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 41 of file fresnelblend.cpp.
References lux::AbsDot(), lux::SWCSpectrum::AddWeighted(), Alpha, lux::CosTheta(), lux::MicrofacetDistribution::D(), depth, distribution, lux::Dot(), M_PI, cimg_library::cimg::max(), lux::Normalize(), Rd, Rs, and SchlickFresnel().
Referenced by Sample_f(), and SchlickFresnel().
float FresnelBlend::Pdf | ( | const TsPack * | tspack, | |
const Vector & | wi, | |||
const Vector & | wo | |||
) | const [virtual] |
Reimplemented from lux::BxDF.
Definition at line 95 of file fresnelblend.cpp.
References distribution, INV_PI, lux::MicrofacetDistribution::Pdf(), lux::SameHemisphere(), and lux::Vector::z.
Referenced by Sample_f().
bool FresnelBlend::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 65 of file fresnelblend.cpp.
References lux::CosineSampleHemisphere(), distribution, f(), Pdf(), lux::MicrofacetDistribution::Sample_f(), and lux::Vector::z.
SWCSpectrum lux::FresnelBlend::SchlickFresnel | ( | float | costheta | ) | const [inline] |
SWCSpectrum lux::FresnelBlend::Alpha [private] |
Definition at line 54 of file fresnelblend.h.
Referenced by f().
float lux::FresnelBlend::depth [private] |
Definition at line 55 of file fresnelblend.h.
Referenced by f().
Definition at line 56 of file fresnelblend.h.
Referenced by f(), FresnelBlend(), Pdf(), and Sample_f().
SWCSpectrum lux::FresnelBlend::Rd [private] |
Definition at line 54 of file fresnelblend.h.
Referenced by f().
SWCSpectrum lux::FresnelBlend::Rs [private] |
Definition at line 54 of file fresnelblend.h.
Referenced by f().