The first big project for my Advanced Computer Graphics class was to build a ray tracer. It was built almost entirely from scratch with C++ and uses OpenGL's math library, GLM.
This Cornell Box, which contains all Lambert-shaded spheres, has two differently-colored lights.
In the second part of the project, we implemented a range of different materials — Lambert, Blinn-Phong, reflective, and refractive. The refraction method is implemented from scratch and takes total internal refraction into account.
This Cornell Box contains a variety of different materials. The left-hand refractive sphere simulates water, and has an air-like sphere in it. On the right is a white Lambert sphere inside of a green transmissive sphere, and the top right sphere is a water-like refractive sphere with a reflective sphere inside.
For the third part of the assignment, I implemented different sampling and warping functions. These were then used for area lights (with random, grid, and stratified sampling) and ambient occlusion (using uniform hemisphere sampling).
This area light uses stratified sampling for the shadows.
I used stratified sampling and a uniform hemisphere warping function to implement ambient occlusion.