The focus on this project was to create a light cache that I can construct, sample and visualize. I plan to use the subsequent code in my thesis research. I chose to follow Eric Tabellion's lead and focus on using view-Dependant samples to generate fast and efficient light cache in order to generate fast samples of ambient light. The major paper that I researched for this project was "Point-Based Approximate Color Bleeding" and came from Pixar.
Similar to the Pixar paper, I chose to ray-trace into my scene from a viewport capable of seeing most of the scene and sampling wherever the rays strike surfaces. I chose to relate the area of each surfel based on the size of the sample-set, allowing them to get smaller as more surfels appear in the scene.
Each surfel contains a number of elements of data required in order to later gather the data properly. A radius is required to show its area of effect, as is a normal in order to properly sample the sample from different angles. Finally, the diffuse value of that point must be taken using typical direct-lighting in order to properly figure out the color contribution.
An octree was chosen to manage the input data, mostly because Octrees give us the ability to sample at different resolutions. For this implementation, and considering the time available for this project, I chose to sample at the highest resolution, not taking advantage of the benefits of having a multi-resolution cache. The cache was filled as the samples were traced, each leaf node only holding 16 surfels at a time. Therefore, whenever more surfels enters a leaf node than it can handle, it will subdivide into 8 new leaf nodes.
After the scene has been sampled, we ray-trace again, but this time at the camera's perspective. We gather the lighting contribution which then applies to the final pixel. Due to time constraints, a simpler (and less efficient) monte-carlo sampling technique was used.
The cache had a few holes, both in the implementation and the results themselves. If you look at any of the generated images, you'll notice strange circular inconsistencies in the image. These were caused by holes in the cache, or incorrect Octree intersections. These happened too late in the development process, and will obviously be ironed out later.