Raytracer

This project involved writing my own raytracer. A raytracer is typically divided up into three parts: the ray generation, ray intersection, and the shading. For each pixel in the image, a viewing ray is calculated and checked for any intersection with the geometric objects in the scene. The raytracer handles scenes made up of spheres, triangles and quad meshes. At each intersection, more rays are created to add direct illumination and shadows, specular reflections, and refractions. Direct illumination and shadows are generated by sending rays from intersection points to point lights. Specular reflections are generated by sending more rays recursively into the scene with a recursive depth of three. These refractions are generated by sending transmission rays through dielectric materials. Combining the results of these rays yields each pixel color in turn. 

This scene shows specular reflections on the yellow and blue ellipsoid as well as a shadow on the blue ellipsoid from the magenta triangle.

In addition to showing specular reflections, this scene shows refractions through the pyramid in the center.

This scene shows a high amount of specular reflections between the blue spheres.