Indirect Illumination With Environment Maps

- Using Raytracing -

Mike Buerli
CSC 572 - Dr. Zoe Wood
Spring 2012

Introduction

This project explores the possibilities of improving render time of scenes with indirect illumination using environment maps. The process of gathering an indirect illumination is often very costly. It requires casting out additional rays for every intersection; a large enough amount so to limit the noise of the sampling. Methods like Point-Based Approximate Color Bleeding and Photon Mapping attempt to speed up this gathering phase, by storing point clouds of surfels or KD-trees of radiance. During the following phase, light is gathered from the respective data structure and integrated over per point. With the use of environment maps as a form of local radiance storage, this project attempts to find an alternate mean of radiance storage and gathering that will provide quicker gathering and allow for faster approximation of homogeneous regions.



Environment Maps

An environment map, simply put, is a cube of textures surrounding an object. It can be represented by a texture containing six faces, which folded together form a cube. The advantages of using a environment map, are its compact storage and quick gathering. Because the cube is axis-aligned it provides fast access and sampling for a given position and direction within the cube.



Unfolded and folded representation of a enviroment map.

An environment map can be used for a variety of things. One example is to map it on a sphere for reflections using the view vector and the normal. Another is to use just the normal of the intersection and Normal map the environment.



Reflective and Normal mapping on a sphere.

MonteCarlo Indirect Illumination

- With Environment Maps -

As previously mentioned, the MonteCarlo method works by casting out additional rays from the intersection into the scene. These rays sample the hemisphere centered around the normal of the intersection. The sampling is done using a randomized cosine distribution about the given normal. The gathered light is integrated and added to the normal lighting of the given intersection.



Image rendered using MonteCarlo Method with 40 rays/intersection.

- With Adaptive Environment Maps -

One way to speed integration up, is to use adaptive environment maps. By downsampling the environment map, one can acquire a larger portion of the illumination in the hemisphere surrounding the intersection with fewer samples. Because the radiance has already been integrated into larger chunks, the indirect illumination will better represent the approximate global illumination. However, a major fallback of this method is that reducing the sampling of hemisphere produces more noise due to the inadequate distribution of samples on the hemisphere.



Images rendered using only 10 MonteCarlo rays.

Integrating Environment Maps

For sampling indirect illumination from environment maps, a new approach could be taken in trying to integrate the discrete environment map itself for a given position and direction. Using the most forward facing face of the environment map from the intersection's normal, an integration square can be created around the position that intersection's normal and position project to. The size of this square is dependent on the distance to the projected point. This square is then used to integrate discrete pixels within the square with a bell or gaussian curve centered about the center of the square. The weighting from the curve is necessary to emphasize radiance closer to the normal. This method allows for only one sample to be cast at the environment map, however requires a good deal of computation (especially the weighting) dependent on the environment maps resolution.



Integrating an unfolded enviroment map.

The resulting indirect illumination shows some unwanted artifacts at the edges of the bleed color. These artifacts are due to the method of integration disregarding the sample distribution. Because the environment map is a not sphere, pixels in the corners and edges of the cube are given greater weight in the lighting calculation. Overall, a better method could be developed to better represent the distribution of sampling over the discrete environment map however it borders being to computationally expensive.



Indirect Illumination achieved from integrating the environment map.

Results

Taking a step backwards, the greatest speedup seen without creating artifacts was achieved along the way. While integrating the environment map may not be feasible (even though it could potentially get rid of noise completely), projecting the intersection's direction onto the axis-aligned cube provides a significant improvement over casting additional rays. In the following pictures, the left column uses MonteCarlo sampling of the environment map while the right uses environment map projection with the same amount of samples (however to the lower resolution map). The render time is cut in more than half.




MonteCarlo Vs. Environment Map Projection

Future Work

There is no doubt that some speedup can be achieved by localizing radiance data in environment maps. Future work on this topic will include different integration schemes, an possible discretization of hemisphere sampling. For larger scenes, environment mapping can provide a hierarchical approximation of detail using oct-trees. Furthermore the oct-tree of environment maps can serve to more quickly approximate homogeneous regions with lower resolution.



References