Monte Carlo Sampling
By: Steven Udall
Description:
This is an implementation of Monte Carlo Sampling into a ray tracer. Sampling ray directions were chosen based on cosine weighted hemisphere Lambertian BRDF for diffuse emission and Phong BRDF for specular reflection. Rays are weighted based on importance to the total pixel color and terminated when their weight is below a certain percentage threshold using Russian Roulette or when they have exceeded the maximum bounce depth. Direct lighting was also added to help the scene converge faster. For lighting, a spherical area light source was used. Below is a 10 sample image of a scene followed by a 2500 sample image of the same scene. Of course, as more samples are taken, the pixel color converges toward the expected color; therefore, there are still some pixels not colored correctly even 2500 samples and 29 hours later.
References:
Lambertian Lighting BRDF
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.31.3313&rep=rep1&type=ps
Phong BRDF
Implementing MC into a raytracer and easy to understand explaination of how Monte Carlo sampling works
http://inst.eecs.berkeley.edu/~cs294-13/fa09/lectures/294-lecture5.pdf
Monte Carlo details
www.cs.rutgers.edu/~decarlo/readings/mcrt-sg03c.pdf
http://en.wikipedia.org/wiki/Monte_Carlo_method
Rotating a vector about an axis using quaternions
http://www.cprogramming.com/tutorial/3d/quaternions.html
Monte Carlo and importance sampling
http://ib.berkeley.edu/labs/slatkin/eriq/classes/.../mc_lecture_notes.pdf