#include "pbrt.h"
#include "geometry.h"
#include "spectrum.h"
Go to the source code of this file.
Functions | |
int | SHTerms (int lmax) |
int | SHIndex (int l, int m) |
void | SHEvaluate (const Vector &v, int lmax, float *out) |
void | SHWriteImage (const char *filename, const Spectrum *c, int lmax, int yres) |
template<typename Func > | |
void | SHProjectCube (Func func, const Point &p, int res, int lmax, Spectrum *coeffs) |
void | SHProjectIncidentDirectRadiance (const Point &p, float pEpsilon, float time, MemoryArena &arena, const Scene *scene, bool computeLightVisibility, int lmax, RNG &rng, Spectrum *c_d) |
void | SHProjectIncidentIndirectRadiance (const Point &p, float pEpsilon, float time, const Renderer *renderer, Sample *origSample, const Scene *scene, int lmax, RNG &rng, int nSamples, Spectrum *c_i) |
void | SHReduceRinging (Spectrum *c, int lmax, float lambda=.005f) |
void | SHRotate (const Spectrum *c_in, Spectrum *c_out, const Matrix4x4 &m, int lmax, MemoryArena &arena) |
void | SHRotateZ (const Spectrum *c_in, Spectrum *c_out, float alpha, int lmax) |
void | SHRotateXMinus (const Spectrum *c_in, Spectrum *c_out, int lmax) |
void | SHRotateXPlus (const Spectrum *c_in, Spectrum *c_out, int lmax) |
void | SHConvolveCosTheta (int lmax, const Spectrum *c_in, Spectrum *c_out) |
void | SHConvolvePhong (int lmax, float n, const Spectrum *c_in, Spectrum *c_out) |
void | SHComputeDiffuseTransfer (const Point &p, const Normal &n, float rayEpsilon, const Scene *scene, RNG &rng, int nSamples, int lmax, Spectrum *c_transfer) |
void | SHComputeTransferMatrix (const Point &p, float rayEpsilon, const Scene *scene, RNG &rng, int nSamples, int lmax, Spectrum *T) |
void | SHComputeBSDFMatrix (const Spectrum &Kd, const Spectrum &Ks, float roughness, RNG &rng, int nSamples, int lmax, Spectrum *B) |
void | SHMatrixVectorMultiply (const Spectrum *M, const Spectrum *v, Spectrum *vout, int lmax) |
void SHComputeBSDFMatrix | ( | const Spectrum & | Kd, | |
const Spectrum & | Ks, | |||
float | roughness, | |||
RNG & | rng, | |||
int | nSamples, | |||
int | lmax, | |||
Spectrum * | B | |||
) |
Definition at line 437 of file sh.cpp.
References BSDF::Add(), arena, BSDF_ALLOC, CosTheta(), BSDF::f(), CoefficientSpectrum< nSamples >::IsBlack(), RNG::RandomUInt(), Sample02(), SHEvaluate(), SHTerms(), UniformSampleSphere(), and UniformSpherePdf().
Referenced by GlossyPRTIntegrator::Preprocess().
void SHComputeDiffuseTransfer | ( | const Point & | p, | |
const Normal & | n, | |||
float | rayEpsilon, | |||
const Scene * | scene, | |||
RNG & | rng, | |||
int | nSamples, | |||
int | lmax, | |||
Spectrum * | c_transfer | |||
) |
Definition at line 390 of file sh.cpp.
References AbsDot(), ALLOCA, Dot(), Scene::IntersectP(), RNG::RandomUInt(), Sample02(), SHEvaluate(), SHTerms(), UniformSampleSphere(), and UniformSpherePdf().
Referenced by DiffusePRTIntegrator::Li().
void SHComputeTransferMatrix | ( | const Point & | p, | |
float | rayEpsilon, | |||
const Scene * | scene, | |||
RNG & | rng, | |||
int | nSamples, | |||
int | lmax, | |||
Spectrum * | T | |||
) |
Definition at line 413 of file sh.cpp.
References ALLOCA, Scene::IntersectP(), RNG::RandomUInt(), Sample02(), SHEvaluate(), SHTerms(), UniformSampleSphere(), and UniformSpherePdf().
Referenced by GlossyPRTIntegrator::Li().
Definition at line 362 of file sh.cpp.
References lambda(), and SHIndex().
Referenced by UseRadianceProbes::Li().
void SHEvaluate | ( | const Vector & | v, | |
int | lmax, | |||
float * | out | |||
) |
Definition at line 165 of file sh.cpp.
References ALLOCA, Assert, K(), legendrep(), Vector::Length(), Severe(), SHIndex(), SHTerms(), sinCosIndexed(), Vector::x, Vector::y, and Vector::z.
Referenced by UseRadianceProbes::Li(), GlossyPRTIntegrator::Li(), SHComputeBSDFMatrix(), SHComputeDiffuseTransfer(), SHComputeTransferMatrix(), PointLight::SHProject(), Light::SHProject(), InfiniteAreaLight::SHProject(), SHProjectCube(), SHProjectIncidentIndirectRadiance(), and SHWriteImage().
int SHIndex | ( | int | l, | |
int | m | |||
) | [inline] |
Definition at line 42 of file sh.h.
Referenced by SHConvolveCosTheta(), SHConvolvePhong(), SHEvaluate(), SHReduceRinging(), SHRotateXMinus(), and SHRotateZ().
Definition at line 486 of file sh.cpp.
References SHTerms().
Referenced by GlossyPRTIntegrator::Li().
void SHProjectCube | ( | Func | func, | |
const Point & | p, | |||
int | res, | |||
int | lmax, | |||
Spectrum * | coeffs | |||
) | [inline] |
Definition at line 50 of file sh.h.
References ALLOCA, Dot(), Normalize(), SHEvaluate(), and SHTerms().
Referenced by InfiniteAreaLight::SHProject().
void SHProjectIncidentDirectRadiance | ( | const Point & | p, | |
float | pEpsilon, | |||
float | time, | |||
MemoryArena & | arena, | |||
const Scene * | scene, | |||
bool | computeLightVisibility, | |||
int | lmax, | |||
RNG & | rng, | |||
Spectrum * | c_d | |||
) |
Definition at line 261 of file sh.cpp.
References MemoryArena::Alloc(), Scene::lights, Light::SHProject(), SHReduceRinging(), and SHTerms().
Referenced by GlossyPRTIntegrator::Preprocess(), DiffusePRTIntegrator::Preprocess(), and CreateRadProbeTask::Run().
void SHProjectIncidentIndirectRadiance | ( | const Point & | p, | |
float | pEpsilon, | |||
float | time, | |||
const Renderer * | renderer, | |||
Sample * | origSample, | |||
const Scene * | scene, | |||
int | lmax, | |||
RNG & | rng, | |||
int | nSamples, | |||
Spectrum * | c_i | |||
) |
Definition at line 277 of file sh.cpp.
References ALLOCA, arena, Sample::Duplicate(), MemoryArena::FreeAll(), INFINITY, Renderer::Li(), Sample::n1D, Sample::n2D, Sample::oneD, RNG::RandomFloat(), RNG::RandomUInt(), RoundUpPow2(), Sample02(), SHEvaluate(), SHTerms(), CameraSample::time, Sample::twoD, UniformSampleSphere(), and UniformSpherePdf().
Referenced by CreateRadProbeTask::Run().
void SHReduceRinging | ( | Spectrum * | c, | |
int | lmax, | |||
float | lambda = .005f | |||
) |
Definition at line 316 of file sh.cpp.
References SHIndex().
Referenced by SHProjectIncidentDirectRadiance().
void SHRotate | ( | const Spectrum * | c_in, | |
Spectrum * | c_out, | |||
const Matrix4x4 & | m, | |||
int | lmax, | |||
MemoryArena & | arena | |||
) |
Definition at line 325 of file sh.cpp.
References MemoryArena::Alloc(), SHRotateXMinus(), SHRotateXPlus(), SHRotateZ(), SHTerms(), and toZYZ().
Referenced by GlossyPRTIntegrator::Li().
Definition at line 30 of file shrots.cpp.
References SHIndex(), and SHRotateXPlus().
Referenced by SHRotate().
Definition at line 48 of file shrots.cpp.
Referenced by SHRotate(), and SHRotateXMinus().
Definition at line 338 of file sh.cpp.
References ALLOCA, Assert, SHIndex(), and sinCosIndexed().
Referenced by SHRotate().
int SHTerms | ( | int | lmax | ) | [inline] |
Definition at line 37 of file sh.h.
Referenced by UseRadianceProbes::c_inXYZ(), DiffusePRTIntegrator::DiffusePRTIntegrator(), UseRadianceProbes::Li(), GlossyPRTIntegrator::Li(), DiffusePRTIntegrator::Li(), GlossyPRTIntegrator::Preprocess(), CreateRadianceProbes::Render(), CreateRadProbeTask::Run(), SHComputeBSDFMatrix(), SHComputeDiffuseTransfer(), SHComputeTransferMatrix(), SHEvaluate(), SHMatrixVectorMultiply(), PointLight::SHProject(), Light::SHProject(), InfiniteAreaLight::SHProject(), SHProjectCube(), SHProjectIncidentDirectRadiance(), SHProjectIncidentIndirectRadiance(), SHRotate(), SHWriteImage(), and UseRadianceProbes::UseRadianceProbes().
void SHWriteImage | ( | const char * | filename, | |
const Spectrum * | c, | |||
int | lmax, | |||
int | yres | |||
) |
Definition at line 237 of file sh.cpp.
References ALLOCA, M_PI, SHEvaluate(), SHTerms(), SphericalDirection(), RGBSpectrum::ToRGB(), and WriteImage().