sh.cpp File Reference

#include "stdafx.h"
#include "sh.h"
#include "scene.h"
#include "integrator.h"
#include "intersection.h"
#include "montecarlo.h"
#include "imageio.h"
#include <float.h>

Go to the source code of this file.

Defines

#define P(l, m)   out[SHIndex(l,m)]
#define M(a, b)   (m.m[a][b])

Functions

static void legendrep (float x, int lmax, float *out)
static float fact (float v)
static float divfact (int a, int b)
static float K (int l, int m)
static float dfact (float v)
static void sinCosIndexed (float s, float c, int n, float *sout, float *cout)
static void toZYZ (const Matrix4x4 &m, float *alpha, float *beta, float *gamma)
static float lambda (float l)
void SHEvaluate (const Vector &w, int lmax, float *out)
void SHWriteImage (const char *filename, const Spectrum *c, int lmax, int yres)
void SHProjectIncidentDirectRadiance (const Point &p, float pEpsilon, float time, MemoryArena &arena, const Scene *scene, bool computeLightVis, 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 ns, Spectrum *c_i)
void SHReduceRinging (Spectrum *c, int lmax, float lambda)
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 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)

Define Documentation

#define M ( a,
 )     (m.m[a][b])
#define P ( l,
 )     out[SHIndex(l,m)]

Function Documentation

static float dfact ( float  v  )  [static]

Definition at line 115 of file sh.cpp.

Referenced by legendrep().

static float divfact ( int  a,
int  b 
) [inline, static]

Definition at line 104 of file sh.cpp.

Referenced by K().

static float fact ( float  v  )  [inline, static]

Definition at line 121 of file sh.cpp.

Referenced by legendrep().

static float K ( int  l,
int  m 
) [inline, static]

Definition at line 99 of file sh.cpp.

References divfact(), and INV_FOURPI.

Referenced by SHEvaluate().

static float lambda ( float  l  )  [inline, static]

Definition at line 158 of file sh.cpp.

References M_PI.

Referenced by FBm(), SHConvolveCosTheta(), SHConvolvePhong(), and Turbulence().

static void legendrep ( float  x,
int  lmax,
float *  out 
) [static]

Definition at line 36 of file sh.cpp.

References Assert, dfact(), fact(), and P.

Referenced by SHEvaluate().

void SHComputeBSDFMatrix ( const Spectrum Kd,
const Spectrum Ks,
float  roughness,
RNG rng,
int  nSamples,
int  lmax,
Spectrum B 
)
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 SHConvolveCosTheta ( int  lmax,
const Spectrum c_in,
Spectrum c_out 
)

Definition at line 362 of file sh.cpp.

References lambda(), and SHIndex().

Referenced by UseRadianceProbes::Li().

void SHConvolvePhong ( int  lmax,
float  n,
const Spectrum c_in,
Spectrum c_out 
)

Definition at line 378 of file sh.cpp.

References lambda(), and SHIndex().

void SHEvaluate ( const Vector w,
int  lmax,
float *  out 
)
void SHMatrixVectorMultiply ( const Spectrum M,
const Spectrum v,
Spectrum vout,
int  lmax 
)

Definition at line 486 of file sh.cpp.

References SHTerms().

Referenced by GlossyPRTIntegrator::Li().

void SHProjectIncidentDirectRadiance ( const Point p,
float  pEpsilon,
float  time,
MemoryArena arena,
const Scene scene,
bool  computeLightVis,
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  ns,
Spectrum c_i 
)
void SHReduceRinging ( Spectrum c,
int  lmax,
float  lambda 
)

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 
)
void SHRotateZ ( const Spectrum c_in,
Spectrum c_out,
float  alpha,
int  lmax 
)

Definition at line 338 of file sh.cpp.

References ALLOCA, Assert, SHIndex(), and sinCosIndexed().

Referenced by SHRotate().

void SHWriteImage ( const char *  filename,
const Spectrum c,
int  lmax,
int  yres 
)
static void sinCosIndexed ( float  s,
float  c,
int  n,
float *  sout,
float *  cout 
) [static]

Definition at line 127 of file sh.cpp.

Referenced by SHEvaluate(), and SHRotateZ().

static void toZYZ ( const Matrix4x4 m,
float *  alpha,
float *  beta,
float *  gamma 
) [static]

Definition at line 141 of file sh.cpp.

References M.

Referenced by SHRotate().

Generated on Sat Aug 28 20:00:12 2010 for pbrt by  doxygen 1.6.3