#include <bxdf.h>
Public Member Functions | |
MixBSDF (const DifferentialGeometry &dgs, const Normal &ngeom) | |
void | Add (float weight, BSDF *bsdf) |
virtual int | NumComponents () const |
virtual int | NumComponents (BxDFType flags) const |
virtual void | SetCompositingParams (CompositingParams *cp) |
virtual bool | Sample_f (const TsPack *tspack, const Vector &o, Vector *wi, float u1, float u2, float u3, SWCSpectrum *const f, float *pdf, BxDFType flags=BSDF_ALL, BxDFType *sampledType=NULL, float *pdfBack=NULL, bool reverse=false) const |
virtual float | Pdf (const TsPack *tspack, const Vector &wo, const Vector &wi, BxDFType flags=BSDF_ALL) const |
virtual SWCSpectrum | f (const TsPack *tspack, const Vector &woW, const Vector &wiW, BxDFType flags=BSDF_ALL) const |
virtual SWCSpectrum | rho (const TsPack *tspack, BxDFType flags=BSDF_ALL) const |
virtual SWCSpectrum | rho (const TsPack *tspack, const Vector &wo, BxDFType flags=BSDF_ALL) const |
Private Member Functions | |
virtual | ~MixBSDF () |
Private Attributes | |
int | nBSDFs |
BSDF * | bsdfs [MAX_BxDFS] |
float | weights [MAX_BxDFS] |
float | totalWeight |
Definition at line 196 of file bxdf.h.
MixBSDF::MixBSDF | ( | const DifferentialGeometry & | dgs, | |
const Normal & | ngeom | |||
) |
virtual lux::MixBSDF::~MixBSDF | ( | ) | [inline, private, virtual] |
void lux::MixBSDF::Add | ( | float | weight, | |
BSDF * | bsdf | |||
) | [inline] |
Definition at line 314 of file bxdf.h.
References bsdfs, MAX_BxDFS, nBSDFs, totalWeight, and weights.
Referenced by lux::MixMaterial::GetBSDF().
SWCSpectrum MixBSDF::f | ( | const TsPack * | tspack, | |
const Vector & | woW, | |||
const Vector & | wiW, | |||
BxDFType | flags = BSDF_ALL | |||
) | const [virtual] |
Implements lux::BSDF.
Definition at line 515 of file bxdf.cpp.
References lux::AbsDot(), lux::SWCSpectrum::AddWeighted(), bsdfs, nBSDFs, lux::BSDF::nn, totalWeight, and weights.
Referenced by rho().
int lux::MixBSDF::NumComponents | ( | ) | const [inline, virtual] |
SWCSpectrum MixBSDF::rho | ( | const TsPack * | tspack, | |
const Vector & | wo, | |||
BxDFType | flags = BSDF_ALL | |||
) | const [virtual] |
Implements lux::BSDF.
Definition at line 542 of file bxdf.cpp.
References lux::SWCSpectrum::AddWeighted(), bsdfs, f(), nBSDFs, lux::BSDF::rho(), totalWeight, and weights.
SWCSpectrum MixBSDF::rho | ( | const TsPack * | tspack, | |
BxDFType | flags = BSDF_ALL | |||
) | const [virtual] |
Implements lux::BSDF.
Definition at line 534 of file bxdf.cpp.
References lux::SWCSpectrum::AddWeighted(), bsdfs, f(), nBSDFs, lux::BSDF::rho(), totalWeight, and weights.
bool MixBSDF::Sample_f | ( | const TsPack * | tspack, | |
const Vector & | o, | |||
Vector * | wi, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
SWCSpectrum *const | f, | |||
float * | pdf, | |||
BxDFType | flags = BSDF_ALL , |
|||
BxDFType * | sampledType = NULL , |
|||
float * | pdfBack = NULL , |
|||
bool | reverse = false | |||
) | const [virtual] |
Samples the BSDF. Returns the result of the BSDF for the sampled direction in f.
Implements lux::BSDF.
Definition at line 447 of file bxdf.cpp.
References lux::AbsDot(), lux::SWCSpectrum::AddWeighted(), bsdfs, lux::BSDF::f(), nBSDFs, lux::BSDF::nn, lux::BSDF::Pdf(), totalWeight, and weights.
virtual void lux::MixBSDF::SetCompositingParams | ( | CompositingParams * | cp | ) | [inline, virtual] |
Reimplemented from lux::BSDF.
Definition at line 203 of file bxdf.h.
References bsdfs, lux::BSDF::compParams, and nBSDFs.
Referenced by lux::MixMaterial::GetBSDF().
BSDF* lux::MixBSDF::bsdfs[MAX_BxDFS] [private] |
Definition at line 229 of file bxdf.h.
Referenced by Add(), f(), NumComponents(), Pdf(), rho(), Sample_f(), and SetCompositingParams().
int lux::MixBSDF::nBSDFs [private] |
Definition at line 228 of file bxdf.h.
Referenced by Add(), f(), MixBSDF(), NumComponents(), Pdf(), rho(), Sample_f(), and SetCompositingParams().
float lux::MixBSDF::totalWeight [private] |
float lux::MixBSDF::weights[MAX_BxDFS] [private] |