#include <sphericalfunction.h>
Public Member Functions | |
SampleableSphericalFunction (boost::shared_ptr< const SphericalFunction > aFunc, int xRes=512, int yRes=256) | |
~SampleableSphericalFunction () | |
RGBColor | f (float phi, float theta) const |
RGBColor | Sample_f (float u1, float u2, Vector *w, float *pdf) const |
float | Pdf (const Vector &w) const |
float | Average_f () const |
Private Attributes | |
int | nVDistribs |
Distribution1D * | uDistrib |
Distribution1D ** | vDistribs |
boost::shared_ptr< const SphericalFunction > | func |
A spherical functions that allows efficient sampling.
Definition at line 113 of file sphericalfunction.h.
lux::SampleableSphericalFunction::SampleableSphericalFunction | ( | boost::shared_ptr< const SphericalFunction > | aFunc, | |
int | xRes = 512 , |
|||
int | yRes = 256 | |||
) |
Definition at line 42 of file sphericalfunction.cpp.
lux::SampleableSphericalFunction::~SampleableSphericalFunction | ( | ) |
Definition at line 76 of file sphericalfunction.cpp.
float lux::SampleableSphericalFunction::Average_f | ( | ) | const |
Returns the average function value over the entire sphere.
Definition at line 117 of file sphericalfunction.cpp.
Referenced by lux::PointLight::Power(), and lux::AreaLight::Power().
RGBColor lux::SampleableSphericalFunction::f | ( | float | phi, | |
float | theta | |||
) | const [virtual] |
Evaluates this function for the given direction.
phi | The angle in the xy plane. | |
theta | The angle from the z axis. |
Implements lux::SphericalFunction.
Definition at line 84 of file sphericalfunction.cpp.
Referenced by GonioBxDF::f(), GonioAreaBxDF::f(), lux::PointLight::L(), lux::AreaLight::L(), and lux::AreaLight::Power().
float lux::SampleableSphericalFunction::Pdf | ( | const Vector & | w | ) | const |
Computes the pdf for sampling the given direction.
w | The direction. |
Definition at line 106 of file sphericalfunction.cpp.
Referenced by lux::PointLight::Sample_L().
RGBColor lux::SampleableSphericalFunction::Sample_f | ( | float | u1, | |
float | u2, | |||
Vector * | w, | |||
float * | ||||
) | const |
Samples this spherical function.
u1 | The first random value. | |
u2 | The second random value. | |
w | The address to store the sampled direction in. | |
The address to store the pdf (w.r.t. solid angle) of the sample direction in. |
Definition at line 88 of file sphericalfunction.cpp.
Referenced by lux::PointLight::Sample_L().
boost::shared_ptr<const SphericalFunction> lux::SampleableSphericalFunction::func [private] |
Definition at line 154 of file sphericalfunction.h.
Definition at line 151 of file sphericalfunction.h.
Definition at line 152 of file sphericalfunction.h.
Definition at line 153 of file sphericalfunction.h.