#include <spot.h>
Public Member Functions | |
SpotLight (const Transform &light2world, const boost::shared_ptr< Texture< SWCSpectrum > > L, float gain, float width, float fall) | |
virtual | ~SpotLight () |
virtual bool | IsDeltaLight () const |
virtual bool | IsEnvironmental () const |
float | Falloff (const Vector &w) const |
virtual SWCSpectrum | Power (const TsPack *tspack, const Scene *) const |
virtual SWCSpectrum | Sample_L (const TsPack *tspack, const Point &P, float u1, float u2, float u3, Vector *wo, float *pdf, VisibilityTester *visibility) const |
virtual SWCSpectrum | Sample_L (const TsPack *tspack, const Scene *scene, float u1, float u2, float u3, float u4, Ray *ray, float *pdf) const |
virtual float | Pdf (const Point &, const Vector &) const |
virtual float | Pdf (const Point &p, const Normal &n, const Point &po, const Normal &ns) const |
virtual bool | Sample_L (const TsPack *tspack, const Scene *scene, float u1, float u2, float u3, BSDF **bsdf, float *pdf, SWCSpectrum *Le) const |
virtual bool | Sample_L (const TsPack *tspack, const Scene *scene, const Point &p, const Normal &n, float u1, float u2, float u3, BSDF **bsdf, float *pdf, float *pdfDirect, VisibilityTester *visibility, SWCSpectrum *Le) const |
virtual SWCSpectrum | Le (const TsPack *tspack, const Scene *scene, const Ray &r, const Normal &n, BSDF **bsdf, float *pdf, float *pdfDirect) const |
Static Public Member Functions | |
static Light * | CreateLight (const Transform &light2world, const ParamSet ¶mSet, const TextureParams &tp) |
Private Attributes | |
float | cosTotalWidth |
float | cosFalloffStart |
Point | lightPos |
boost::shared_ptr< Texture < SWCSpectrum > > | Lbase |
DifferentialGeometry | dummydg |
float | gain |
Definition at line 32 of file spot.h.
SpotLight::SpotLight | ( | const Transform & | light2world, | |
const boost::shared_ptr< Texture< SWCSpectrum > > | L, | |||
float | gain, | |||
float | width, | |||
float | fall | |||
) |
Definition at line 72 of file spot.cpp.
References cosFalloffStart, cosTotalWidth, gain, Lbase, lightPos, lux::Light::LightToWorld, and Radians().
Referenced by CreateLight().
Light * SpotLight::CreateLight | ( | const Transform & | light2world, | |
const ParamSet & | paramSet, | |||
const TextureParams & | tp | |||
) | [static] |
Definition at line 148 of file spot.cpp.
References lux::CoordinateSystem(), lux::ParamSet::FindOneFloat(), lux::ParamSet::FindOnePoint(), blender::g, lux::Transform::GetInverse(), lux::TextureParams::GetSWCSpectrumTexture(), lux::Normalize(), SpotLight(), lux::Translate(), lux::Point::x, lux::Vector::x, lux::Point::y, lux::Vector::y, lux::Point::z, and lux::Vector::z.
float SpotLight::Falloff | ( | const Vector & | w | ) | const |
Definition at line 86 of file spot.cpp.
References cosFalloffStart, cosTotalWidth, LocalFalloff(), lux::Normalize(), and lux::Light::WorldToLight.
Referenced by Sample_L().
virtual bool lux::SpotLight::IsDeltaLight | ( | ) | const [inline, virtual] |
Implements lux::Light.
virtual bool lux::SpotLight::IsEnvironmental | ( | ) | const [inline, virtual] |
Implements lux::Light.
SWCSpectrum SpotLight::Le | ( | const TsPack * | tspack, | |
const Scene * | scene, | |||
const Ray & | r, | |||
const Normal & | n, | |||
BSDF ** | bsdf, | |||
float * | pdf, | |||
float * | pdfDirect | |||
) | const [virtual] |
Reimplemented from lux::Light.
float SpotLight::Pdf | ( | const Point & | p, | |
const Normal & | n, | |||
const Point & | po, | |||
const Normal & | ns | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 100 of file spot.cpp.
References lux::AbsDot(), lux::DistanceSquared(), and lux::Normalize().
Implements lux::Light.
virtual SWCSpectrum lux::SpotLight::Power | ( | const TsPack * | tspack, | |
const Scene * | ||||
) | const [inline, virtual] |
Implements lux::Light.
Definition at line 41 of file spot.h.
References cosFalloffStart, cosTotalWidth, dummydg, Lbase, and M_PI.
bool SpotLight::Sample_L | ( | const TsPack * | tspack, | |
const Scene * | scene, | |||
const Point & | p, | |||
const Normal & | n, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
BSDF ** | bsdf, | |||
float * | pdf, | |||
float * | pdfDirect, | |||
VisibilityTester * | visibility, | |||
SWCSpectrum * | Le | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 126 of file spot.cpp.
References BSDF_ALLOC, lux::CoordinateSystem(), cosFalloffStart, cosTotalWidth, dummydg, gain, Lbase, lux::Vector::LengthSquared(), lightPos, lux::Light::LightToWorld, lux::VisibilityTester::SetSegment(), and lux::TsPack::time.
bool SpotLight::Sample_L | ( | const TsPack * | tspack, | |
const Scene * | scene, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
BSDF ** | bsdf, | |||
float * | pdf, | |||
SWCSpectrum * | Le | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 114 of file spot.cpp.
References BSDF_ALLOC, lux::CoordinateSystem(), cosFalloffStart, cosTotalWidth, dummydg, gain, Lbase, lightPos, and lux::Light::LightToWorld.
SWCSpectrum SpotLight::Sample_L | ( | const TsPack * | tspack, | |
const Scene * | scene, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
float | u4, | |||
Ray * | ray, | |||
float * | ||||
) | const [virtual] |
Implements lux::Light.
Definition at line 105 of file spot.cpp.
References cosTotalWidth, lux::Ray::d, dummydg, Falloff(), gain, Lbase, lightPos, lux::Light::LightToWorld, lux::Ray::o, lux::UniformConePdf(), and lux::UniformSampleCone().
SWCSpectrum SpotLight::Sample_L | ( | const TsPack * | tspack, | |
const Point & | P, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
Vector * | wo, | |||
float * | pdf, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 89 of file spot.cpp.
References lux::DistanceSquared(), dummydg, Falloff(), gain, Lbase, lightPos, lux::Normalize(), lux::VisibilityTester::SetSegment(), and lux::TsPack::time.
float lux::SpotLight::cosFalloffStart [private] |
Definition at line 63 of file spot.h.
Referenced by Falloff(), Power(), Sample_L(), and SpotLight().
float lux::SpotLight::cosTotalWidth [private] |
Definition at line 63 of file spot.h.
Referenced by Falloff(), Power(), Sample_L(), and SpotLight().
DifferentialGeometry lux::SpotLight::dummydg [private] |
Definition at line 66 of file spot.h.
Referenced by Power(), and Sample_L().
float lux::SpotLight::gain [private] |
Definition at line 67 of file spot.h.
Referenced by Sample_L(), and SpotLight().
boost::shared_ptr< Texture<SWCSpectrum> > lux::SpotLight::Lbase [private] |
Definition at line 65 of file spot.h.
Referenced by Power(), Sample_L(), and SpotLight().
Point lux::SpotLight::lightPos [private] |
Definition at line 64 of file spot.h.
Referenced by Sample_L(), and SpotLight().