Caustics are light patterns formed when light passes through materials like glass and water, they are difficult to render accurately and quickly. I developed this project as part of one my university modules, Advanced Technologies, with a five-week timeline to create a prototype. As such, I chose to focus on the accuracy and developed a Monte Carlo path tracer.
Monte Carlo path tracing is a technique for simulating the interaction of radiation in a scene. In 1986, James T. Kajiya described an adaptation of this technique called the rendering equation.
Monte Carlo path tracers, due to their stochastic sampling method, suffer from a lot of noise in the images produced. One way to reduce this noise is to use importance sampling , which uses Probability Density Functions to cause light to scatter towards more important parts of the scene, like lights. Caustics are made sharper by small light sources, however this increases noise as without importance sampling rays are very unlikely to hit the light. By using Importance Sampling the level of noise can be reduced significantly.
To simulate the interaction of light within the body of the water, Henyey–Greenstein Phase Functions are used in this project to simulate volumes. Phase Functions are used to describe the angular scattering of light by a material and can be used to evaluate how light is scattered by a medium.
Below is a scene showcasing all the elements of the final raytracer: