For my CS 488 final project, I improved upon the ray tracer I built for a previous assignment to include advanced effects and optimizations. I started with the goal to build a renderer that can imitate the art style of the artist k3, who specializes in colorful and fun 3D renderings.
2. Transparency + refraction
Caustics were not implemented due to lack of time.
4. Soft shadows
The following three images show the same scene rendered with 3 different lights:
5. Texture mapping
6. Constructive solid geometry
7. Additional primitives: cylinder and cone
8. Normal interpolation for Phong shading
Not completed due to lack of time.
9. Uniform spatial partitioning for meshes
Uniform spatial partitioning can be enabled for each individual mesh object. The following scene (from A4) contains 3 cow models, each with 5804 polygons.
This scene was rendered with increasing number of partitions to compare render time. All renders done with bounding box optimization, 8 threads and no supersampling.
10. Final scene
This is my final scene. Inspired by artworks by k3.
The following is the same scene rendered at a larger size. Unfortunately, this rendering didn’t finish until past the submission deadline.
Schlick’s approximation of Fresnel reflection
I implemented Schlick’s approximation of Fresnel refraction to make my glass objects look better. Here is a comparison:
Tracing of rays is split among a number of worker threads. Here are the rendering times for the reflection scene at 2x supersampling, on a Intel 4 core CPU with hyper-threading:
Bounding box optimization for meshes
For meshes with large number of polygons, significant time savings can be achieved by first testing rays against the mesh’s bounding box. Rendering times for macho-cows.lua (8 threads, no supersampling):
Without bounding box optimization: 854 seconds (14.2 minutes)
With bounding box optimization: 27.161 seconds