Light Caching Using Surfels

Chris Gibson
CSC 572 - Dr. Zoe Wood

Description

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.

Details

Sampling Surfels

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.


Samples rendered from the perspective of the "light" camera.

Spatial Data Structure

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.


This is the scene rendered from one perspective, but the samples rendered from another. The surfels have been reduced in size in order to set them apart from each other for clarity, they would not normally be drawn this way in the gather stage.

The "Gather" Stage

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.


Here is the low-sampled ambient term for a scene. This is applied to the direct lighting render.

Problems Encountered

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.


Here you can see low sampling of the light cache reveals the holes, where rays escape and don't contribute to the end ambient term.

Media

The following examples were generated using monte-carlo samples of the light cache. Please note that, due to problems with filling the scene seamlessly with the cache samples, holes in the scene and missing samples leave artifacts.


References