Final Render

Output Normalized z-buffer

Render time 0:01:28. Without the bounding box check, the same scene took 0:10:18.

Ray-Plane Intersections (No Triangles)

Output Normalized z-buffer

With Ray-Triangle intersection unimplemented (just has a return false), I first implemented Ray-Plane intersections as suggested. Render time 0:00:01.

Ray-Triangle Intersections With Geometry Normals

Output Normalized z-buffer

Here, everything except ray-box intersection has been implemented correctly, but the normals are not interpolated using the barycentric coordinates. I use the geometry normals, computed using vertex positions. This results in the so-called flat shading. Render time 0:00:25 (low-res teapot).

Interpolated Normals

Output Normalized z-buffer

This is the same scene as above, but with interpolated normals. Render time 0:00:24 (still no bounding box intersection). The first thing that occurred to me after this render is that the shadows look off. It's easy to see why that is so, shadows are computed using the low-res geometry, no interpolation is involved when you query the light source with a shadow ray. The low-res geometry simply gives a low-res shadow, the exact same shadow as in the render without normal interpolation.

Machine Specs

Processor 1.4 GHz Intel Core i5
RAM 4 GB 1600 MHz DDR3
Graphics Intel HD Graphics 5000 1536 MB
Software Xcode 9.0 on macOS Sierra 10.12.6