#include <sun.h>
Public Member Functions | |
SunLight (const Transform &light2world, const float sunscale, const Vector &dir, float turb, float relSize, int ns) | |
bool | IsDeltaLight () const |
SWCSpectrum | Sample_L (const Point &p, Vector *wi, VisibilityTester *) const |
SWCSpectrum | Power (const Scene *scene) const |
SWCSpectrum | Le (const RayDifferential &r) const |
SWCSpectrum | Le (const Scene *scene, const Ray &r, const Normal &n, BSDF **bsdf, float *pdf, float *pdfDirect) const |
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 |
float | Pdf (const Point &, const Vector &) const |
SWCSpectrum | Sample_L (const Scene *scene, float u1, float u2, BSDF **bsdf, float *pdf) const |
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 |
Static Public Member Functions | |
static Light * | CreateLight (const Transform &light2world, const ParamSet ¶mSet) |
Private Attributes | |
Vector | sundir |
Vector | x |
Vector | y |
float | turbidity |
float | thetaS |
float | phiS |
float | V |
float | cosThetaMax |
SPD * | LSPD |
Definition at line 33 of file sun.h.
SunLight::SunLight | ( | const Transform & | light2world, | |
const float | sunscale, | |||
const Vector & | dir, | |||
float | turb, | |||
float | relSize, | |||
int | ns | |||
) |
Definition at line 61 of file sun.cpp.
References lux::CoordinateSystem(), cimg_library::cos(), cosThetaMax, cimg_library::exp(), lux::Light::LightToWorld, LSPD, LUX_LIMIT, LUX_WARNING, luxError, M_PI, lux::Normalize(), phiS, cimg_library::pow(), lux::SPD::sample(), lux::SPD::Scale(), lux::SphericalPhi(), lux::SphericalTheta(), cimg_library::sqrt(), lux::sun_k_gAmplitudes, lux::sun_k_gWavelengths, lux::sun_k_oAmplitudes, lux::sun_k_oWavelengths, lux::sun_k_waAmplitudes, lux::sun_k_waWavelengths, lux::sun_sun_irradiance, sundir, thetaS, turbidity, x, and y.
Referenced by CreateLight().
Definition at line 262 of file sun.cpp.
References lux::ParamSet::FindOneFloat(), lux::ParamSet::FindOneInt(), lux::ParamSet::FindOneVector(), lux::Light::nSamples, sundir, and SunLight().
bool lux::SunLight::IsDeltaLight | ( | ) | const [inline, virtual] |
SWCSpectrum SunLight::Le | ( | const Scene * | scene, | |
const Ray & | r, | |||
const Normal & | n, | |||
BSDF ** | bsdf, | |||
float * | pdf, | |||
float * | pdfDirect | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 143 of file sun.cpp.
References lux::AbsDot(), lux::BBox::BoundingSphere(), BSDF_ALLOC, cosThetaMax, lux::Ray::d, lux::DistanceSquared(), lux::Dot(), lux::BSDF::f(), LSPD, M_PI, lux::Ray::o, sundir, lux::UniformConePdf(), lux::Scene::WorldBound(), x, and y.
SWCSpectrum SunLight::Le | ( | const RayDifferential & | r | ) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 136 of file sun.cpp.
References cosThetaMax, lux::Ray::d, lux::Dot(), LSPD, and sundir.
Referenced by Sample_L().
Implements lux::Light.
Definition at line 194 of file sun.cpp.
References cosThetaMax, and lux::UniformConePdf().
SWCSpectrum lux::SunLight::Power | ( | const Scene * | scene | ) | const [inline, virtual] |
Implements lux::Light.
Definition at line 39 of file sun.h.
References lux::BBox::BoundingSphere(), LSPD, M_PI, and lux::Scene::WorldBound().
SWCSpectrum SunLight::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] |
Reimplemented from lux::Light.
Definition at line 233 of file sun.cpp.
References lux::AbsDot(), lux::BBox::BoundingSphere(), BSDF_ALLOC, cosThetaMax, lux::DistanceSquared(), lux::Dot(), LSPD, M_PI, lux::VisibilityTester::SetSegment(), sundir, lux::UniformConePdf(), lux::UniformSampleCone(), lux::Scene::WorldBound(), x, and y.
SWCSpectrum SunLight::Sample_L | ( | const Scene * | scene, | |
float | u1, | |||
float | u2, | |||
BSDF ** | bsdf, | |||
float * | ||||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 218 of file sun.cpp.
References lux::BBox::BoundingSphere(), BSDF_ALLOC, lux::ConcentricSampleDisk(), cosThetaMax, LSPD, M_PI, sundir, lux::Scene::WorldBound(), x, and y.
SWCSpectrum SunLight::Sample_L | ( | const Scene * | scene, | |
float | u1, | |||
float | u2, | |||
float | u3, | |||
float | u4, | |||
Ray * | ray, | |||
float * | ||||
) | const [virtual] |
Implements lux::Light.
Definition at line 201 of file sun.cpp.
References lux::BBox::BoundingSphere(), lux::ConcentricSampleDisk(), cosThetaMax, lux::Ray::d, LSPD, M_PI, lux::Ray::o, sundir, lux::UniformConePdf(), lux::UniformSampleCone(), lux::Scene::WorldBound(), x, and y.
SWCSpectrum SunLight::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 168 of file sun.cpp.
References cosThetaMax, LSPD, Sample_L(), lux::VisibilityTester::SetRay(), sundir, lux::UniformConePdf(), lux::UniformSampleCone(), x, and y.
SWCSpectrum SunLight::Sample_L | ( | const Point & | p, | |
Vector * | wi, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 180 of file sun.cpp.
References cosThetaMax, lux::random::floatValue(), Le(), LSPD, lux::VisibilityTester::SetRay(), and sundir.
Referenced by Sample_L().
float lux::SunLight::cosThetaMax [private] |
Definition at line 67 of file sun.h.
Referenced by IsDeltaLight(), Le(), Pdf(), Sample_L(), and SunLight().
SPD* lux::SunLight::LSPD [private] |
Definition at line 68 of file sun.h.
Referenced by Le(), Power(), Sample_L(), and SunLight().
float lux::SunLight::phiS [private] |
Definition at line 66 of file sun.h.
Referenced by SunLight().
Vector lux::SunLight::sundir [private] |
Definition at line 62 of file sun.h.
Referenced by CreateLight(), Le(), Sample_L(), and SunLight().
float lux::SunLight::thetaS [private] |
Definition at line 66 of file sun.h.
Referenced by SunLight().
float lux::SunLight::turbidity [private] |
Definition at line 65 of file sun.h.
Referenced by SunLight().
float lux::SunLight::V [private] |
Vector lux::SunLight::x [private] |
Definition at line 64 of file sun.h.
Referenced by Le(), Sample_L(), and SunLight().
Vector lux::SunLight::y [private] |
Definition at line 64 of file sun.h.
Referenced by Le(), Sample_L(), and SunLight().