Ray Tracer

Final project for CS488. Coded in C++.


Implemented primitives: box, sphere, torus, cylinder.

Texture mapping

All primitives may be textured. All faces may receive a different texture (e.g. the dice has unique textures on all sides).

Bump maps

Bump map implemented using average RGB value as depth. Severity of normal perturbation may be adjusted per bump map.


All materials may have a variable amount of reflective property. Reflected rays continue recursively up to a maximum constant.


All materials may have a variable amount of refractive property. Refracted rays continue recursively up to a maximum constant.

Adaptive anti-aliasing

Supersampling applied to only pixels with large color variation to its neighbours. Color variation threshold may be adjusted. Depending on the image, this reduces supersampling time by 90-95%.

Soft ahadows

Multiple shadow rays are sent per image ray collision. Average of all shadow ray samples taken to create soft shadow effect.

Depth of field

Each image is rendered multiple times, with perturbance in eye location. All images are averaged to achieve blurring.

Glossy reflection

Glossy reflections achieved through perturbing reflected rays and taking an average of multiple perturbed rays

Glossy refraction

Like glossy reflections, but perturbing refracted rays.

Phong shading

Interpolate normals at each triangle's vertices, using Barycentric coordinates. Backwards compatibility is maintained with models without normals.

Motion blur

A motion vector may be specified for each object. The magnitude of the vector corresponds to the speed of the object. Multiple renderings are taken and then averaged, with varying object positions based on motion vector.


A demonstration of multiple features and object placement.


720 images were individually rendered using features from above. Utilized many techniques from the Twelve Principles of Animation. Multithreading the raytracer significantly improved render time.