#include <light.h>
Public Member Functions | |
AreaLight (const Transform &light2world, const Spectrum &power, float g, int ns, const boost::shared_ptr< Shape > &shape) | |
~AreaLight () | |
virtual SWCSpectrum | L (const Point &p, const Normal &n, const Vector &w) const |
virtual SWCSpectrum | L (const Ray &ray, const DifferentialGeometry &dg, const Normal &n, BSDF **bsdf, float *pdf, float *pdfDirect) const |
SWCSpectrum | Power (const Scene *) const |
bool | IsDeltaLight () const |
float | Pdf (const Point &, const Vector &) const |
float | Pdf (const Point &, const Normal &, const Vector &) const |
SWCSpectrum | Sample_L (const Point &P, Vector *w, VisibilityTester *visibility) const |
virtual SWCSpectrum | Sample_L (const Point &P, const Normal &N, float u1, float u2, float u3, Vector *wo, float *pdf, VisibilityTester *visibility) const |
virtual SWCSpectrum | Sample_L (const Point &P, float u1, float u2, float u3, Vector *wo, float *pdf, VisibilityTester *visibility) const |
SWCSpectrum | Sample_L (const Scene *scene, float u1, float u2, float u3, float u4, Ray *ray, float *pdf) const |
virtual SWCSpectrum | Sample_L (const Scene *scene, float u1, float u2, BSDF **bsdf, float *pdf) const |
virtual SWCSpectrum | Sample_L (const Scene *scene, const Point &p, const Normal &n, float u1, float u2, float u3, BSDF **bsdf, float *pdf, float *pdfDirect, VisibilityTester *visibility) const |
virtual float | Pdf (const Scene *scene, const Point &p) const |
void | SamplePosition (float u1, float u2, Point *p, Normal *n, float *pdf) const |
void | SampleDirection (float u1, float u2, const Normal &nn, Vector *wo, float *pdf) const |
float | EvalPositionPdf (const Point p, const Normal &n, const Vector &w) const |
float | EvalDirectionPdf (const Point p, const Normal &n, const Vector &w) const |
SWCSpectrum | Eval (const Normal &n, const Vector &w) const |
Static Public Member Functions | |
static AreaLight * | CreateAreaLight (const Transform &light2world, const ParamSet ¶mSet, const boost::shared_ptr< Shape > &shape) |
Protected Attributes | |
SPD * | LSPD |
boost::shared_ptr< Shape > | shape |
float | area |
Definition at line 126 of file light.h.
AreaLight::AreaLight | ( | const Transform & | light2world, | |
const Spectrum & | power, | |||
float | g, | |||
int | ns, | |||
const boost::shared_ptr< Shape > & | shape | |||
) |
Definition at line 36 of file area.cpp.
References area, LSPD, lux::SPD::Scale(), and shape.
Referenced by CreateAreaLight().
AreaLight * AreaLight::CreateAreaLight | ( | const Transform & | light2world, | |
const ParamSet & | paramSet, | |||
const boost::shared_ptr< Shape > & | shape | |||
) | [static] |
Definition at line 186 of file area.cpp.
References AreaLight(), lux::ParamSet::FindOneFloat(), lux::ParamSet::FindOneInt(), lux::ParamSet::FindOneSpectrum(), blender::g, L(), and lux::Light::nSamples.
SWCSpectrum AreaLight::Eval | ( | const Normal & | n, | |
const Vector & | w | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 181 of file area.cpp.
References lux::Dot(), and LSPD.
float AreaLight::EvalDirectionPdf | ( | const Point | p, | |
const Normal & | n, | |||
const Vector & | w | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 177 of file area.cpp.
References lux::AbsDot(), lux::Dot(), and INV_PI.
float AreaLight::EvalPositionPdf | ( | const Point | p, | |
const Normal & | n, | |||
const Vector & | w | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 173 of file area.cpp.
References lux::Dot(), and shape.
bool lux::AreaLight::IsDeltaLight | ( | ) | const [inline, virtual] |
Implements lux::Light.
SWCSpectrum AreaLight::L | ( | const Ray & | ray, | |
const DifferentialGeometry & | dg, | |||
const Normal & | n, | |||
BSDF ** | bsdf, | |||
float * | pdf, | |||
float * | pdfDirect | |||
) | const [virtual] |
M_PI
Definition at line 148 of file area.cpp.
References lux::AbsDot(), BSDF_ALLOC, lux::Ray::d, lux::DistanceSquared(), L(), lux::DifferentialGeometry::nn, lux::Ray::o, lux::DifferentialGeometry::p, and shape.
virtual SWCSpectrum lux::AreaLight::L | ( | const Point & | p, | |
const Normal & | n, | |||
const Vector & | w | |||
) | const [inline, virtual] |
Definition at line 132 of file light.h.
References lux::Dot(), and LSPD.
Referenced by CreateAreaLight(), L(), lux::Intersection::Le(), and Sample_L().
SWCSpectrum lux::AreaLight::Power | ( | const Scene * | ) | const [inline, virtual] |
SWCSpectrum AreaLight::Sample_L | ( | const Scene * | scene, | |
const Point & | p, | |||
const Normal & | n, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
BSDF ** | bsdf, | |||
float * | pdf, | |||
float * | pdfDirect, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
M_PI
Reimplemented from lux::Light.
Definition at line 127 of file area.cpp.
References lux::AbsDot(), BSDF_ALLOC, lux::CoordinateSystem(), lux::DistanceSquared(), L(), lux::Normalize(), lux::VisibilityTester::SetSegment(), and shape.
SWCSpectrum AreaLight::Sample_L | ( | const Scene * | scene, | |
float | u1, | |||
float | u2, | |||
BSDF ** | bsdf, | |||
float * | ||||
) | const [virtual] |
M_PI
Reimplemented from lux::Light.
Definition at line 115 of file area.cpp.
References BSDF_ALLOC, lux::CoordinateSystem(), L(), and shape.
SWCSpectrum AreaLight::Sample_L | ( | const Scene * | scene, | |
float | u1, | |||
float | u2, | |||
float | u3, | |||
float | u4, | |||
Ray * | ray, | |||
float * | ||||
) | const [virtual] |
Implements lux::Light.
Definition at line 92 of file area.cpp.
References lux::Ray::d, lux::Dot(), INV_TWOPI, L(), lux::Ray::o, shape, and lux::UniformSampleSphere().
SWCSpectrum AreaLight::Sample_L | ( | const Point & | P, | |
float | u1, | |||
float | u2, | |||
float | u3, | |||
Vector * | wo, | |||
float * | pdf, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 82 of file area.cpp.
References L(), lux::Normalize(), lux::VisibilityTester::SetSegment(), and shape.
SWCSpectrum AreaLight::Sample_L | ( | const Point & | P, | |
const Normal & | N, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
Vector * | wo, | |||
float * | pdf, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 67 of file area.cpp.
References L(), lux::Normalize(), lux::VisibilityTester::SetSegment(), and shape.
SWCSpectrum AreaLight::Sample_L | ( | const Point & | P, | |
Vector * | w, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 105 of file area.cpp.
References lux::random::floatValue(), L(), lux::Normalize(), lux::VisibilityTester::SetSegment(), and shape.
void AreaLight::SampleDirection | ( | float | u1, | |
float | u2, | |||
const Normal & | nn, | |||
Vector * | wo, | |||
float * | ||||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 162 of file area.cpp.
References lux::AbsDot(), lux::CosineSampleHemisphere(), INV_PI, and lux::TransformAccordingNormal().
float lux::AreaLight::area [protected] |
Definition at line 166 of file light.h.
Referenced by AreaLight(), and Power().
SPD* lux::AreaLight::LSPD [protected] |
Definition at line 164 of file light.h.
Referenced by AreaLight(), Eval(), L(), Power(), and ~AreaLight().
boost::shared_ptr<Shape> lux::AreaLight::shape [protected] |
Definition at line 165 of file light.h.
Referenced by AreaLight(), EvalPositionPdf(), L(), Pdf(), Sample_L(), and SamplePosition().