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

Irradiance cache data structure based on "A Ray Tracing Solution for Diffuse Interreflection" by Greg J. Ward, Francis M. Rubinstein and Robert D. Clear (Computer Graphics, Volume 22, Number 4, August 1988) More...

#include <mitsuba/render/irrcache.h>

+ Inheritance diagram for mitsuba::IrradianceCache:


struct  Record

Public Member Functions

 IrradianceCache (const AABB &aabb)
 IrradianceCache (Stream *stream, InstanceManager *manager)
void setQuality (Float quality)
void clampInfluence (Float min, Float max)
void clampScreen (bool active)
void clampNeighbor (bool active)
void useGradients (bool active)
Recordput (const RayDifferential &ray, const Intersection &its, const HemisphereSampler &hs)
bool get (const Intersection &its, Spectrum &E) const
void insert (Record *rec)
 Manually insert an irradiance record. More...
void serialize (Stream *stream, InstanceManager *manager) const
std::string toString () const
 Return a string representation. More...
virtual const ClassgetClass () const
 Retrieve this object's class. More...
- Public Member Functions inherited from mitsuba::SerializableObject
 SerializableObject (Stream *stream, InstanceManager *manager)
 Unserialize a serializable object. 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 mitsuba::SerializableObject
static Classm_theClass
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...

Protected Member Functions

virtual ~IrradianceCache ()
 Release all memory. More...
- Protected Member Functions inherited from mitsuba::SerializableObject
 SerializableObject ()
 Construct a serializable object. More...
virtual ~SerializableObject ()
 Virtual deconstructor. More...
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...

Protected Attributes

DynamicOctree< Record * > m_octree
std::vector< Record * > m_records
Float m_kappa
Float m_sceneSize
Float m_minDist
Float m_maxDist
bool m_clampScreen
bool m_clampNeighbor
bool m_useGradients
ref< Mutexm_mutex

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

Irradiance cache data structure based on "A Ray Tracing Solution for Diffuse Interreflection" by Greg J. Ward, Francis M. Rubinstein and Robert D. Clear (Computer Graphics, Volume 22, Number 4, August 1988)

with extensions from "Irradiance Gradients" by Greg J. Ward and Paul S. Heckbert (1992 Eurographics Workshop on Rendering).

Includes optimizations proposed by Jaroslav Krivanek et al. in "Making Radiance and Irradiance Caching Practical: Adaptive Caching and Neighbor Clamping" (in EGSR 2006),


"An Approximate Global Illumination System for Computer Generated Films" by E. Tabellion and A. Lamorlette (SIGGRAPH 2004)

Wenzel Jakob

Constructor & Destructor Documentation

mitsuba::IrradianceCache::IrradianceCache ( const AABB aabb)

Create an empty irradiance of the given size

mitsuba::IrradianceCache::IrradianceCache ( Stream stream,
InstanceManager manager 

Unserialize an irradiance cache from a binary data stream

virtual mitsuba::IrradianceCache::~IrradianceCache ( )

Release all memory.

Member Function Documentation

void mitsuba::IrradianceCache::clampInfluence ( Float  min,
Float  max 

Set the influence region cutoff values of samples in the cache. Will be multiplied by the scene size

void mitsuba::IrradianceCache::clampNeighbor ( bool  active)

Enable neighbor clamping?

void mitsuba::IrradianceCache::clampScreen ( bool  active)

Minimal influence region falloff with increasing distance

bool mitsuba::IrradianceCache::get ( const Intersection its,
Spectrum E 
) const

Use the irradiance cache to interpolate/extrapolate an irradiance value for the given position and surface normal Returns false on a cache miss

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

Retrieve this object's class.

Reimplemented from mitsuba::SerializableObject.

void mitsuba::IrradianceCache::insert ( Record rec)

Manually insert an irradiance record.

Record* mitsuba::IrradianceCache::put ( const RayDifferential ray,
const Intersection its,
const HemisphereSampler hs 

Add a sample to the irradiance cache

rayRay differentials (if they exist)
itsThe position/normal of the surface in question
sampleRecord containing all hemispherical samples and derived gradient information
void mitsuba::IrradianceCache::serialize ( Stream stream,
InstanceManager manager 
) const

Serialize an irradiance cache to a binary data stream

Implements mitsuba::SerializableObject.

void mitsuba::IrradianceCache::setQuality ( Float  quality)

Set the quality parameter from the Tabellion and Lamorlette paper. Once samples have been stored, this should only be decreased.

std::string mitsuba::IrradianceCache::toString ( ) const

Return a string representation.

Reimplemented from Object.

void mitsuba::IrradianceCache::useGradients ( bool  active)

Enable/disable irradiance gradients

Member Data Documentation

bool mitsuba::IrradianceCache::m_clampNeighbor
bool mitsuba::IrradianceCache::m_clampScreen
Float mitsuba::IrradianceCache::m_kappa
Float mitsuba::IrradianceCache::m_maxDist
Float mitsuba::IrradianceCache::m_minDist
ref<Mutex> mitsuba::IrradianceCache::m_mutex
DynamicOctree<Record *> mitsuba::IrradianceCache::m_octree
std::vector<Record *> mitsuba::IrradianceCache::m_records
Float mitsuba::IrradianceCache::m_sceneSize
Class* mitsuba::IrradianceCache::m_theClass
bool mitsuba::IrradianceCache::m_useGradients

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