Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::SHSampler Class Reference

Implementation of 'Importance Sampling Spherical Harmonics' by W. Jarsz, N. Carr and H. W. Jensen (EUROGRAPHICS 2009) More...

#include <mitsuba/core/shvector.h>

+ Inheritance diagram for mitsuba::SHSampler:

Public Member Functions

 SHSampler (int bands, int depth)
 Precompute a spherical harmonics sampler object. More...
 
Float warp (const SHVector &f, Point2 &sample) const
 Warp a uniform sample in [0,1]^2 to one that is approximately proportional to the specified function. More...
 
std::string toString () const
 Return information on the size of the precomputed tables. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

virtual ~SHSampler ()
 Virtual destructor. More...
 
int I (int l, int m) const
 
int P (int m) const
 
Float lookupIntegral (int depth, int zBlock, int phiBlock, int l, int m) const
 
FloatlegendreIntegrals (Float a, Float b)
 Recursively compute assoc. legendre & phi integrals. More...
 
FloatphiIntegrals (Float a, Float b)
 
Float integrate (int depth, int zBlock, int phiBlock, const SHVector &f) const
 Integrate a SH expansion over the specified mip-map region. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Protected Attributes

int m_bands
 
int m_depth
 
Float *** m_phiMap
 
Float *** m_legendreMap
 
int m_dataSize
 
Floatm_normalization
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 

Detailed Description

Implementation of 'Importance Sampling Spherical Harmonics' by W. Jarsz, N. Carr and H. W. Jensen (EUROGRAPHICS 2009)

Constructor & Destructor Documentation

mitsuba::SHSampler::SHSampler ( int  bands,
int  depth 
)

Precompute a spherical harmonics sampler object.

Parameters
bandsNumber of SH coefficient bands to support
depthNumber of recursive sample warping steps.
virtual mitsuba::SHSampler::~SHSampler ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

virtual const Class* mitsuba::SHSampler::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from Object.

int mitsuba::SHSampler::I ( int  l,
int  m 
) const
inlineprotected
Float mitsuba::SHSampler::integrate ( int  depth,
int  zBlock,
int  phiBlock,
const SHVector f 
) const
protected

Integrate a SH expansion over the specified mip-map region.

Float* mitsuba::SHSampler::legendreIntegrals ( Float  a,
Float  b 
)
protected

Recursively compute assoc. legendre & phi integrals.

Float mitsuba::SHSampler::lookupIntegral ( int  depth,
int  zBlock,
int  phiBlock,
int  l,
int  m 
) const
inlineprotected
int mitsuba::SHSampler::P ( int  m) const
inlineprotected
Float* mitsuba::SHSampler::phiIntegrals ( Float  a,
Float  b 
)
protected
std::string mitsuba::SHSampler::toString ( ) const
virtual

Return information on the size of the precomputed tables.

Reimplemented from Object.

Float mitsuba::SHSampler::warp ( const SHVector f,
Point2 sample 
) const

Warp a uniform sample in [0,1]^2 to one that is approximately proportional to the specified function.

The resulting sample will have spherical coordinates [0,pi]x[0,2pi] and its actual PDF (which might be slightly different from the function evaluated at the sample, even if $f$ is a distribution) will be returned.

Member Data Documentation

int mitsuba::SHSampler::m_bands
protected
int mitsuba::SHSampler::m_dataSize
protected
int mitsuba::SHSampler::m_depth
protected
Float*** mitsuba::SHSampler::m_legendreMap
protected
Float* mitsuba::SHSampler::m_normalization
protected
Float*** mitsuba::SHSampler::m_phiMap
protected
Class* mitsuba::SHSampler::m_theClass
static

The documentation for this class was generated from the following file: