#include <sky.h>
Public Member Functions | |
SkyLight (const Transform &light2world, const float skyscale, int ns, Vector sd, float turb, float aconst, float bconst, float cconst, float dconst, float econst) | |
~SkyLight () | |
SWCSpectrum | Power (const Scene *scene) const |
bool | IsDeltaLight () 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, const Normal &n, float u1, float u2, float u3, Vector *wi, float *pdf, VisibilityTester *visibility) const |
SWCSpectrum | Sample_L (const Point &p, float u1, float u2, float u3, Vector *wi, 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 Normal &, const Vector &) const |
float | Pdf (const Point &, const Vector &) const |
SWCSpectrum | Sample_L (const Point &P, Vector *w, VisibilityTester *visibility) 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 |
Vector | GetSunPosition () const |
void | SunThetaPhi (float &theta, float &phi) const |
Spectrum | GetSunSpectralRadiance () const |
float | GetSunSolidAngle () const |
void | GetSkySpectralRadiance (const float theta, const float phi, SWCSpectrum *const dst_spect) const |
void | GetAtmosphericEffects (const Vector &viewer, const Vector &source, Spectrum &atmAttenuation, Spectrum &atmInscatter) const |
void | InitSunThetaPhi () |
void | ChromaticityToSpectrum (const float x, const float y, SWCSpectrum *const dst_spect) const |
float | PerezFunction (const float *lam, float theta, float phi, float lvz) const |
Static Public Member Functions | |
static Light * | CreateLight (const Transform &light2world, const ParamSet ¶mSet) |
Private Attributes | |
float | skyScale |
Vector | sundir |
float | turbidity |
float | thetaS |
float | phiS |
float | zenith_Y |
float | zenith_x |
float | zenith_y |
float | perez_Y [6] |
float | perez_x [6] |
float | perez_y [6] |
Definition at line 35 of file sky.h.
void SkyLight::ChromaticityToSpectrum | ( | const float | x, | |
const float | y, | |||
SWCSpectrum *const | dst_spect | |||
) | const |
Definition at line 448 of file sky.cpp.
References lux::SWCSpectrum::c, Floor2Int(), lux::S0Amplitudes, lux::S1Amplitudes, lux::S2Amplitudes, thread_wavelengths, and WAVELENGTH_SAMPLES.
Referenced by GetSkySpectralRadiance().
Definition at line 374 of file sky.cpp.
References lux::ParamSet::FindOneFloat(), lux::ParamSet::FindOneInt(), lux::ParamSet::FindOneVector(), lux::Normalize(), lux::Light::nSamples, SkyLight(), and sundir.
Referenced by lux::MakeLight().
void lux::SkyLight::GetAtmosphericEffects | ( | const Vector & | viewer, | |
const Vector & | source, | |||
Spectrum & | atmAttenuation, | |||
Spectrum & | atmInscatter | |||
) | const |
void SkyLight::GetSkySpectralRadiance | ( | const float | theta, | |
const float | phi, | |||
SWCSpectrum *const | dst_spect | |||
) | const |
Definition at line 429 of file sky.cpp.
References ChromaticityToSpectrum(), M_PI, cimg_library::cimg::min(), perez_x, perez_Y, perez_y, PerezFunction(), phiS, RiAngleBetween(), thetaS, lux::SWCSpectrum::y(), zenith_x, zenith_Y, and zenith_y.
Referenced by SkyBxDF::f(), and Le().
Vector lux::SkyLight::GetSunPosition | ( | ) | const |
float lux::SkyLight::GetSunSolidAngle | ( | ) | const |
Spectrum lux::SkyLight::GetSunSpectralRadiance | ( | ) | const |
void SkyLight::InitSunThetaPhi | ( | ) |
Definition at line 406 of file sky.cpp.
References lux::Normalize(), phiS, lux::SphericalPhi(), lux::SphericalTheta(), sundir, and thetaS.
Referenced by SkyLight().
bool lux::SkyLight::IsDeltaLight | ( | ) | const [inline, virtual] |
SWCSpectrum SkyLight::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 120 of file sky.cpp.
References lux::AbsDot(), lux::BBox::BoundingSphere(), BSDF_ALLOC, lux::CoordinateSystem(), lux::Ray::d, lux::DistanceSquared(), lux::Dot(), GetSkySpectralRadiance(), INV_TWOPI, M_PI, lux::Normalize(), lux::Ray::o, skyScale, lux::SphericalPhi(), lux::SphericalTheta(), lux::Scene::WorldBound(), and lux::Light::WorldToLight.
SWCSpectrum SkyLight::Le | ( | const RayDifferential & | r | ) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 106 of file sky.cpp.
References lux::Ray::d, GetSkySpectralRadiance(), lux::Normalize(), skyScale, lux::SphericalPhi(), lux::SphericalTheta(), and lux::Light::WorldToLight.
Referenced by Sample_L().
Reimplemented from lux::Light.
Definition at line 199 of file sky.cpp.
References lux::AbsDot(), and INV_TWOPI.
float SkyLight::PerezFunction | ( | const float * | lam, | |
float | theta, | |||
float | phi, | |||
float | lvz | |||
) | const [inline] |
Definition at line 419 of file sky.cpp.
References cimg_library::cos(), cimg_library::exp(), and thetaS.
Referenced by GetSkySpectralRadiance().
SWCSpectrum lux::SkyLight::Power | ( | const Scene * | scene | ) | const [inline, virtual] |
Implements lux::Light.
Definition at line 40 of file sky.h.
References lux::BBox::BoundingSphere(), M_PI, skyScale, and lux::Scene::WorldBound().
SWCSpectrum SkyLight::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 306 of file sky.cpp.
References lux::AbsDot(), lux::BBox::BoundingSphere(), BSDF_ALLOC, lux::ConcentricSampleDisk(), lux::CoordinateSystem(), lux::DistanceSquared(), lux::Dot(), Floor2Int(), lux::Light::havePortalShape, INV_TWOPI, M_PI, cimg_library::cimg::max(), lux::Normalize(), lux::Light::nrPortalShapes, lux::Light::PortalShapes, lux::VisibilityTester::SetSegment(), skyScale, lux::Scene::WorldBound(), lux::Light::WorldToLight, lux::Normal::x, lux::Vector::x, lux::Normal::y, lux::Vector::y, lux::Normal::z, and lux::Vector::z.
SWCSpectrum SkyLight::Sample_L | ( | const Scene * | scene, | |
float | u1, | |||
float | u2, | |||
BSDF ** | bsdf, | |||
float * | ||||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 290 of file sky.cpp.
References lux::BBox::BoundingSphere(), BSDF_ALLOC, lux::CoordinateSystem(), M_PI, lux::Normalize(), skyScale, lux::UniformSampleSphere(), lux::Scene::WorldBound(), and lux::Light::WorldToLight.
SWCSpectrum SkyLight::Sample_L | ( | const Point & | P, | |
Vector * | w, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 282 of file sky.cpp.
References lux::random::floatValue(), and Sample_L().
SWCSpectrum SkyLight::Sample_L | ( | const Scene * | scene, | |
float | u1, | |||
float | u2, | |||
float | u3, | |||
float | u4, | |||
Ray * | ray, | |||
float * | ||||
) | const [virtual] |
Implements lux::Light.
Definition at line 242 of file sky.cpp.
References lux::AbsDot(), lux::BBox::BoundingSphere(), lux::Ray::d, lux::Dot(), lux::random::floatValue(), Floor2Int(), lux::Light::havePortalShape, INV_TWOPI, Le(), M_PI, lux::Normalize(), lux::Light::nrPortalShapes, lux::Ray::o, lux::Light::PortalShapes, lux::UniformSampleSphere(), and lux::Scene::WorldBound().
SWCSpectrum SkyLight::Sample_L | ( | const Point & | p, | |
float | u1, | |||
float | u2, | |||
float | u3, | |||
Vector * | wi, | |||
float * | pdf, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Implements lux::Light.
Definition at line 203 of file sky.cpp.
References lux::Dot(), Floor2Int(), lux::Light::havePortalShape, Le(), lux::Normalize(), lux::Light::nrPortalShapes, lux::Light::PortalShapes, lux::VisibilityTester::SetRay(), lux::UniformSampleSphere(), and lux::UniformSpherePdf().
SWCSpectrum SkyLight::Sample_L | ( | const Point & | p, | |
const Normal & | n, | |||
float | u1, | |||
float | u2, | |||
float | u3, | |||
Vector * | wi, | |||
float * | pdf, | |||
VisibilityTester * | visibility | |||
) | const [virtual] |
Reimplemented from lux::Light.
Definition at line 149 of file sky.cpp.
References lux::ConcentricSampleDisk(), lux::CoordinateSystem(), lux::Dot(), Floor2Int(), lux::Light::havePortalShape, INV_TWOPI, Le(), cimg_library::cimg::max(), lux::Normalize(), lux::Light::nrPortalShapes, lux::Light::PortalShapes, lux::VisibilityTester::SetRay(), lux::Normal::x, lux::Vector::x, lux::Normal::y, lux::Vector::y, lux::Normal::z, and lux::Vector::z.
Referenced by Sample_L().
void lux::SkyLight::SunThetaPhi | ( | float & | theta, | |
float & | phi | |||
) | const |
float lux::SkyLight::perez_x[6] [private] |
float lux::SkyLight::perez_y[6] [private] |
float lux::SkyLight::perez_Y[6] [private] |
float lux::SkyLight::phiS [private] |
float lux::SkyLight::skyScale [private] |
Vector lux::SkyLight::sundir [private] |
Definition at line 84 of file sky.h.
Referenced by CreateLight(), InitSunThetaPhi(), and SkyLight().
float lux::SkyLight::thetaS [private] |
Definition at line 86 of file sky.h.
Referenced by GetSkySpectralRadiance(), InitSunThetaPhi(), PerezFunction(), and SkyLight().
float lux::SkyLight::turbidity [private] |
float lux::SkyLight::zenith_x [private] |
float lux::SkyLight::zenith_y [private] |
float lux::SkyLight::zenith_Y [private] |