For this project I took a different approach to global illumination called Photon Mapping. The algorithm is pretty simple: emit photons into the scene, let them bounce and scatter until they absorb, and compute the brightness based on the number of photons absorbed. My primary resource on the technique was Realistic Image Synthesis Using Photon Mapping by Henrik Jensen.
Here is a summary of the algorithm I used.
The main difference between this method and the global illumination technique of the previous homework is that there we looped through all the vertices, gathering both direct and indirect light, while here we shoot light from the source into the scene and let it pile up.
I suspect the two algorithms do the same calculation but in different order. The previous one is target-order while this is source-order.
This is low-resolution. I need to redo it at a higher resolution.