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.
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.
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.
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.
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.
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.
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.