#include <sun.h>
Public Member Functions | |
SunLight (const Transform &light2world, const float sunscale, const Vector &dir, float turb, float relSize, int ns) | |
virtual | ~SunLight () |
virtual bool | IsDeltaLight () const |
virtual bool | IsEnvironmental () const |
virtual SWCSpectrum | Power (const TsPack *tspack, const Scene *scene) const |
virtual SWCSpectrum | Le (const TsPack *tspack, const RayDifferential &r) const |
virtual SWCSpectrum | Le (const TsPack *tspack, const Scene *scene, const Ray &r, const Normal &n, BSDF **bsdf, float *pdf, float *pdfDirect) 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 |
Static Public Member Functions | |
static Light * | CreateLight (const Transform &light2world, const ParamSet ¶mSet, const TextureParams &tp) |
Private Member Functions | |
bool | checkPortals (Ray portalRay) const |
Private Attributes | |
Vector | sundir |
Vector | x |
Vector | y |
float | turbidity |
float | thetaS |
float | phiS |
float | V |
float | cosThetaMax |
float | sin2ThetaMax |
SPD * | LSPD |
Definition at line 34 of file sun.h.
SunLight::SunLight | ( | const Transform & | light2world, | |
const float | sunscale, | |||
const Vector & | dir, | |||
float | turb, | |||
float | relSize, | |||
int | ns | |||
) |
Definition at line 68 of file sun.cpp.
References lux::CoordinateSystem(), cimg_library::cos(), cosThetaMax, lux::Light::LightToWorld, LSPD, LUX_LIMIT, LUX_WARNING, luxError, lux::Normalize(), phiS, cimg_library::pow(), lux::SPD::sample(), lux::SPD::Scale(), sin2ThetaMax, lux::SphericalPhi(), lux::SphericalTheta(), 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_solAmplitudes, sundir, thetaS, turbidity, x, and y.
Referenced by CreateLight().
virtual lux::SunLight::~SunLight | ( | ) | [inline, virtual] |
bool SunLight::checkPortals | ( | Ray | portalRay | ) | const [private] |
Definition at line 188 of file sun.cpp.
References lux::Ray::d, lux::Intersection::dg, lux::Dot(), lux::Light::havePortalShape, lux::DifferentialGeometry::nn, lux::Light::nrPortalShapes, and lux::Light::PortalShapes.
Light * SunLight::CreateLight | ( | const Transform & | light2world, | |
const ParamSet & | paramSet, | |||
const TextureParams & | tp | |||
) | [static] |
Definition at line 430 of file sun.cpp.
References lux::ParamSet::FindOneFloat(), lux::ParamSet::FindOneInt(), lux::ParamSet::FindOneVector(), lux::Light::nSamples, sundir, and SunLight().
virtual bool lux::SunLight::IsDeltaLight | ( | ) | const [inline, virtual] |
virtual bool lux::SunLight::IsEnvironmental | ( | ) | const [inline, virtual] |
Implements lux::Light.
SWCSpectrum SunLight::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.
Definition at line 146 of file sun.cpp.
References lux::AbsDot(), lux::BBox::BoundingSphere(), BSDF_ALLOC, cosThetaMax, lux::Ray::d, lux::Intersection::dg, lux::DistanceSquared(), lux::Dot(), lux::BSDF::f(), lux::Light::havePortalShape, LSPD, M_PI, lux::Ray::mint, lux::DifferentialGeometry::nn, lux::Light::nrPortalShapes, lux::Ray::o, lux::DifferentialGeometry::p, lux::Light::PortalShapes, sin2ThetaMax, sundir, lux::UniformConePdf(), lux::Scene::WorldBound(), x, and y.
SWCSpectrum SunLight::Le | ( | const TsPack * | tspack, | |
const RayDifferential & | r | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 138 of file sun.cpp.
References cosThetaMax, lux::Ray::d, lux::Dot(), LSPD, and sundir.
float SunLight::Pdf | ( | const Point & | p, | |
const Normal & | n, | |||
const Point & | po, | |||
const Normal & | ns | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 233 of file sun.cpp.
References lux::AbsDot(), cosThetaMax, lux::DistanceSquared(), lux::Normalize(), and lux::UniformConePdf().
Implements lux::Light.
Definition at line 227 of file sun.cpp.
References cosThetaMax, and lux::UniformConePdf().
virtual SWCSpectrum lux::SunLight::Power | ( | const TsPack * | tspack, | |
const Scene * | scene | |||
) | const [inline, virtual] |
Implements lux::Light.
Definition at line 41 of file sun.h.
References lux::BBox::BoundingSphere(), cosThetaMax, lux::Light::havePortalShape, LSPD, M_PI, lux::Light::PortalArea, and lux::Scene::WorldBound().
bool SunLight::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 367 of file sun.cpp.
References lux::AbsDot(), lux::BBox::BoundingSphere(), BSDF_ALLOC, cosThetaMax, lux::Intersection::dg, lux::DistanceSquared(), lux::Dot(), lux::Light::havePortalShape, LSPD, M_PI, lux::Ray::mint, lux::DifferentialGeometry::nn, lux::Light::nrPortalShapes, lux::DifferentialGeometry::p, lux::Light::PortalShapes, lux::VisibilityTester::SetSegment(), sin2ThetaMax, sundir, lux::TsPack::time, lux::UniformConePdf(), lux::UniformSampleCone(), lux::Scene::WorldBound(), x, and y.
bool SunLight::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 305 of file sun.cpp.
References lux::BBox::BoundingSphere(), BSDF_ALLOC, lux::ConcentricSampleDisk(), lux::Intersection::dg, lux::Dot(), Floor2Int(), lux::Light::havePortalShape, LSPD, M_PI, cimg_library::cimg::min(), lux::Ray::mint, lux::DifferentialGeometry::nn, lux::Light::nrPortalShapes, lux::DifferentialGeometry::p, lux::Light::PortalShapes, sin2ThetaMax, sundir, lux::TsPack::time, lux::DifferentialGeometry::time, lux::Scene::WorldBound(), x, and y.
SWCSpectrum SunLight::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 243 of file sun.cpp.
References lux::BBox::BoundingSphere(), lux::ConcentricSampleDisk(), cosThetaMax, lux::Ray::d, lux::Dot(), lux::RandomGenerator::floatValue(), Floor2Int(), lux::Light::havePortalShape, lux::Vector::Length(), LSPD, M_PI, lux::DifferentialGeometry::nn, lux::Light::nrPortalShapes, lux::Ray::o, lux::DifferentialGeometry::p, lux::Light::PortalShapes, lux::TsPack::rng, sundir, lux::TsPack::time, lux::DifferentialGeometry::time, lux::UniformConePdf(), lux::UniformSampleCone(), lux::Scene::WorldBound(), x, and y.
SWCSpectrum SunLight::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 210 of file sun.cpp.
References cosThetaMax, LSPD, lux::VisibilityTester::SetRay(), sundir, lux::TsPack::time, lux::UniformConePdf(), lux::UniformSampleCone(), x, and y.
float lux::SunLight::cosThetaMax [private] |
Definition at line 74 of file sun.h.
Referenced by IsDeltaLight(), Le(), Pdf(), Power(), Sample_L(), and SunLight().
SPD* lux::SunLight::LSPD [private] |
Definition at line 75 of file sun.h.
Referenced by Le(), Power(), Sample_L(), SunLight(), and ~SunLight().
float lux::SunLight::phiS [private] |
Definition at line 73 of file sun.h.
Referenced by SunLight().
float lux::SunLight::sin2ThetaMax [private] |
Definition at line 74 of file sun.h.
Referenced by Le(), Sample_L(), and SunLight().
Vector lux::SunLight::sundir [private] |
Definition at line 69 of file sun.h.
Referenced by CreateLight(), Le(), Sample_L(), and SunLight().
float lux::SunLight::thetaS [private] |
Definition at line 73 of file sun.h.
Referenced by SunLight().
float lux::SunLight::turbidity [private] |
Definition at line 72 of file sun.h.
Referenced by SunLight().
float lux::SunLight::V [private] |
Vector lux::SunLight::x [private] |
Definition at line 71 of file sun.h.
Referenced by Le(), Sample_L(), and SunLight().
Vector lux::SunLight::y [private] |
Definition at line 71 of file sun.h.
Referenced by Le(), Sample_L(), and SunLight().