Irradiance Caching seeks to solve the computationally intensive problem of inter-diffuse reflectance. Irradiance is the power per unit square area incident on a surface. Given the irradiance at a point on a diffuse Lambertian surface, calculating the reflected radiance is as simple as first calculating radiosity by multiplying irradiance by the surface reflectance, giving you power reflected per unit area. Lambertian surfaces reflect light equally in all directions so dividing by pi (projected solid angle of the hemisphere) gives you the reflected radiance, power per unit area per unit projected solid angle. The Irradiance Caching algorithm calculates irradiance sparsely across a scene, caches these values, interpolates cached values, and finally calculates reflected radiance for diffuse surfaces.
Direct and indirect lighting are both reflected radiance from camera-visible surfaces. Therefore, differentiating the two is not entirely necessary. However, doing so usually leads to increased efficiency, since direct lighting is probably more important visually than indirect lighting. Separating the two allows us to more explicitly decide how much computation time we want to dedicate to each part of a scene's lighting. Also, the general character of these two lighting components is very different. Direct lighting often has sharp discontinuities and indirect lighting is usually smooth, with little spatial variance. We can refer to this separation of lighting contributions as reflected radiance decomposition.
The term 'caching' in rendering usually refers to the reuse of data from one part of a render or a previous time step to render other parts faster. Caching exchanges memory storage for computation time. We save the results of past work, and check whether or not we can use these results for subsequent calculations. The overall effect on the workflow of algorithms employing caching is minor. We are not necessarily adding to an algorithm's complexity, but just trying to find instances where work does not need to be repeated.
These two ideas--reflected radiance decomposition and caching--form the foundation for irradiance caching. Decomposing reflected radiance into direct and indirect lighting led to the observation that indirect lighting and spatial location are highly correlated. A simple way to exploit this correlation and amortize work over many nearby pixels was by utilizing caching.
Irradiance caching works by separating out the lighting caused by inter-reflection among diffuse surfaces from direct lighting in the rendering equation. Due to its low frequency nature, indirect lighting can be sparsely evaluated over the scene at a set of carefully chosen sample points. Interpolation can be performed to reconstruct the signal over the entire scene. At each sample point, Monte Carlo integration is used over the hemisphere of directions to calculate an accurate estimate of irradiance. In addition to this estimate, information from hemisphere sampling is used to estimate how likelihood of spatial changes in lighting. In the original formulation, the harmonic mean of the distances to intersection points in hemisphere sampling is used. This number is linearly scaled by a user-provided parameter to designate how close new irradiance calculations must be to stored records in order to have a cache hit.
Originally, hemisphere integration was only used to calculate a single irradiance value and average distance to intersection points. However, the hundreds or even thousands of ray traces required for this integral contains a lot more information about the lighting at a given point. Ward introduced irradiance gradients for irradiance caching to better utilize this information. Irradiance gradients are computed during hemisphere sampling and are used to improve interpolation, extrapolation, and cache spacing of the irradiance cache. Irradiance gradients are an estimate of the magnitude of irradiance change for each spatial direction and rotation angle. Using irradiance gradients results in a marked improvement in interpolation quality with little additional computation and no additional ray tracing.
Because irradiance caching is a world-space caching approach, distant surfaces which cover few pixels in a rendered image, but a large area in world-space can result in too many cache misses. Tabellion and Lamorlette introduced an error metric and weighting function to space cache points evenly in screen space, replacing the harmonic mean calculation with a minimum, clamped to ensure adjacent image pixels on the same surface do not create new cache records. This optimization serves to place irradiance cache points in a way more sensitive to the final output image. To our knowledge, this technique marks the first published documentation of irradiance caching being used in a feature animated film.
In 2006, Krivanek et al. introduced neighbor clamping and adaptive caching, reducing the area in which poor estimates are visible and increasing the density of cache points where a visual discontinuity of irradiance is detected, respectively. Neighbor clamping works by looking at nearby cache points when a point is added to the irradiance cache and checking whether or not the radius of the cache point being added is geometrically plausible. This process helps prevent cases where hemisphere sampling misses small, nearby scene objects, or rays leak through geometry because of numerical precision problems. Also when adding a cache point to the irradiance cache, adaptive caching can detect whether or not interpolation between nearby cache points will result in a visible discontinuity. Once detected, this discontinuity can be prevented by reducing the radius of the cache point to be added and nearby cache points, consequently increasing the local density of cache points.
At SIGGRAPH 2008 work was presented for enhancing the smooth appearance of indirect illumination by increasing the area that irradiance cache points overlap. This change causes a simple blurring of the indirect lighting function an irradiance cache represents. More cache points are used in any given interpolation, reducing the influence of outliers, trading local accuracy for a generally smoother appearance.