Techniques of Global Illumination

Paul Doyle - CSC 473 - Spring 2013

My goal for this project was to compare two different techniques for global illumination for raytracers using CUDA to parallelize computations on the GPU. I wasn't able to completely implement both of them, but I learned some things about the technologies along the way.

Photon Mapping

Photon mapping is the first approach that I attempted. Unfortunately, it's a multi-step process and requires a good portion of the solution to be written before anything can even be seen. I was unable to actually complete my renderer with this method of GI, but I did get part way through.

Step 1. Cast Photons

The first step involves casting photons from the lights. Photons are small packets of light represented by a position, direction, and power (also contains the color). Photons are cast from the light sources in the scene in different directions based on the shape of the light source. They then bounce around the scene, following diffuse and specular Monte Carlo rules and also sometimes being transmitted or reflected in dielectric interactions. Photons have a chance of being absorbed at each surface they hit, and once absorbed they stop at that position. The random absorption allows the photons to be evenly distributed throughout the scene.

Step 2. Build kd-tree

The second step is performed for the sake of sheer speed. This step involves generating a kd-tree to hold the photons that have been cast into the scene. The use of a kd-tree allows for more effective gathering algorithms in the next step.

Step 3. Raytrace and Gather

Using the kd-tree and a K-Nearest-Neighbor search algorithmm, the nearest photons to a given raytraced point can be gathered and accumulated. This was a part that I had a lot of trouble with, because I could not find clear documentation on how the accumulated photons affect the point in question.

Above are some images visualizing the locations of approximately 1000 photons cast into the scene. Since my photon casting was fairly simplified, only a small number are visible because others were cast out of the scene. It's also evident that the photons don't quite fill the room as evenly as desired.

Monte Carlo Path Tracing

The other technique is Monte Carlo path-tracing, which involves a more parallel-friendly version of the standard recursive Monte Carlo approach. I was able to fully implement the path tracing approach, despite some odd color bleeding behavior that resulted from my use of the objects' diffuse property in two different ways.

Results

More Passes, Smoother Picture

The technique can be performed using progressive passes (however many are chosen). The above images were generated with different numbers of passes. The 8 pass image was be completed in less than 10 seconds, while the 25k pass image took approximately 45 minutes. As you can see, the greater the number of passes, the more the randomized rays converge and the smoother the final image.