Ray Tracer

Ray Tracer written in C++ by myself and Thomas Buckley. Features and missing components are listed below the images.

Area Lights (for soft shadows): We simulate circular area lights by implementing a new light type with a radius parameter. The ray tracer then samples this disk (instead of a single point) when calculating the shadow ray intersection in order to obtain soft shadows.

Ambient Occlusion: We implemented ambient occlusion by adding a new light type that acts like an ambient light but instead casts shadow rays that are sampled from the unit hemisphere at the intersection point. Thus we can darken areas that are closer to other objects.

Bump-mapping: We support bump-mapping, where normal maps are passed into the raytracer through the MTL file and then read from when calculating specular and diffuse lighting.

Depth of Field: We added lens diameter, focal distance, and view plane distance parameters and then sample based on this lens radius. Thus we are able to perturb the initial rays that are being traced from the camera to progressively blur objects that are farther away from the focal plane.

Environment Cubes: These are simply materials that do not calculate shading or shadows and thus we can simply apply an environment cube texture to a large cube (with normals flipped) that encompasses the scene. This simulates environment mapping and provides some nice results as seen in the images.

Glossy Reflection: The ray tracer uses the multi jittered sampler to sample the unit hemisphere and perturb the reflection ray. The “glossy” setting in the .MTL file can be used to control the sample distribution over the hemisphere and thus control how glossy or mirrored the reflection will be.

Refraction: We added support for refraction, which uses the refraction constants passed in through the MTL file to calculate the trajectory for new rays when rays intersect refractive objects.

Unfortunately we did not have time to implement caustics.