Irradiance Caching With Environment Maps

- Using Raytracing -

Mike Buerli
CSC 570 - Dr. Zoe Wood
Winter 2012-2013


Introduction

The growing demand for realistic renderings in both film and games has led to a number of proposed solutions to the Global Illumination problem. Global Illumination, in order to better imitate natural lighting, needs integration of not only direct illumination but also indirect illumination (irradiance). This requires a great deal more computation, integrating radiance from the rest of the scene over each intersections hemisphere. The simplest approximation to this light integration is to use Monte-Carlo Integration to sample the hemisphere with a given amount of randomness. More recently, methods like Photon Mapping and Point-Based Approximate Color Bleeding (PBACB) have been introduced. These algorithms attempt to speed up the computation by breaking it into two phases; one to store direct illumination (radiance) of the scene and another to gather the radiance from the scene. Photon Mapping uses a KD-tree of photons to store light. Similarly PBACB uses an octree of surfels to represent light in the scene. One major improvement that can be seen in PBACB is the hierarchical approximation or radiance using spherical harmonics. Another improvement can be seen in the gathering phase, where rather than using the neighborhood of photons, PBACB uses rasterization of surfels in order to gather indirect illumination. Lastly, an even more recent technique used to approximate indirect illumination can be seen in Voxel-based Global Illumination (VGI) where a voxel representation of the scene for indirect illumination.


This project explores the use of a voxel-based scene representation with the general two phase indirect illumination taken a step further. Once the irradiance for a given intersection is gathered (rasterized to a cubemap in the case of PBACB) and integrated, it is usually just thrown away. In this project however, we attempt to make use of the gathered irradiance to speed up the results of close-by intersections. This is done using environment maps to cache irradiance in a given neighborhood. Not only will this save time by requiring fewer samples for a given hemisphere, but it will also remove the need for redundant sampling of homogeneous regions.



Normals and Spatial data structure of our regular geometry.

Voxelization

The first phase of rendering indirect illumination is to store radiance (direct lighting) in a spatial data structure. In this case we are using a sparse voxel octree to precompute direct illumination of the geometry at a given resolution. This gives us an approximation of the radiance in the scene.



Voxelization of our scene.

Now we can make use of the voxel representation alongside the regular geometry in order to gather irradiance. The benefit of using voxels is that voxel-tracing is faster than raytracing the regular geometry. Voxels are axis aligned and equivalent in dimension to octree nodes, which makes intersection and search much faster. Additionally, the color of a voxel is precomputed so that no additional rays need to be sent into the scene.



Image rendered using Monte-Carlo Integration in 300 seconds.


Image rendered using Voxel-tracing with the same number of samples in 22.5 seconds.

Environment Maps

In order to cache irradiance, we make use of environment maps. Previously we have seen irradiance rasterized to a cubemap for integration. While this is smart for rasterization (onto five of the six sides of the cube), integration of this gives a sampling that is more concentrated in the corners of the cube. To remedy this we use an environment map with spherical coordinates, in order to give a more uniform sampling of the hemisphere.



Two cube-maps rendered at different intersection points.

Important To Sample

Another thing to note from attempting to integrate over a cube-map, is the importance of sampling. If all samples are uniformly distributed across a cube, more an more artifacts appear. It is important to sample uniformly across a sphere with focus on regions emphasized by the BRDF of your current material.


Sampled with cosine weight versus uniformly across a cube.

Irradiance Caching

Finally, using the voxel representation already created for the scene, we can also store environment maps in the hierarchy. This way, new environment maps are created for axis-aligned regions rather than per ray intersection. The environments maps are created as needed using the scene's memory pool. Samples of irradiance that are voxel-traced are stored in the environment map. Once an environment map patch has received sufficient samples, irradiance is no longer traced but looked up in the environment map. In this way, irradiance is cached in spherical regions and used in every successive ray cast.



Indirect Illumination using environment maps of varying resolution.

Results

The results show a good amount of speedup. With Monte-Carlo sampling as our baseline, just using the voxel representation of the scene gets more than 20x speedup. From here we see that using environment map caching gets around a 1.5x speedup. This is mainly due to the large voxel size used in this metric. For smaller voxel sizes, the speedup due to voxel-tracing will go down and the irradiance caching speedup will go up. Overall, the combined effort shows a reasonable speedup for different scenes.



Direct Illumination Only - 6s



Monte-Carlo Sampling - 273s


Voxel-tracing Indirect Illumination - 12.5s


Irradiance Caching With Environment Maps - 8.5s


Error Images


References