RAY TRACER PROJECT

In this raytracing project, I have modeled a dining table with few dining utensils to demonstrate various special lighting effects, such as mirror reflection, refraction, soft shadow, and caustics. Both quality and performance are important factors to a well-designed raytracer. As a result, adaptive anti-aliasing has been carried out in the scene to improve the image’s quality, multi-processing and uniform spatial subdivision have also been implemented to optimize the raytracer’s efficiency.

To view the project specification: CS488 Final Project

To view the simplified, non-technical description of the project: CS488 made the news

To view other students’ projects: CS488 Gallery

======================================================================================

Objective 1 – Uniform Spatial Subdivision

512x512 Simple Cows (40 objects) on gl10, single-threaded

3D scene box size: length-60, width-24, height-56 

======================================================================================

Objective 2 – Multi-Processing

512x512 Macho Cows on gl10 (6 cores)

======================================================================================

Objective 3 – 3D Object Modeling

======================================================================================

Objective 4 – Mirror Reflection

======================================================================================

Objective 5 – Refraction

======================================================================================

Objective 6 – Texture Mapping

======================================================================================

Objective 7 – Adaptive Anti-aliasing

======================================================================================

Objective 8 – Soft Shadow

======================================================================================

Objective 9 - Caustics

======================================================================================

Objective 10 – Final Scene

No anti-aliasing, no soft-shadow:

With anti-aliasing and soft shadow:

======================================================================================

Afterthoughts and Possible Future Improvements

1. Uniform subdivision is expensive to implement. It is not a very suitable objective for my raytracer, as my final scene does not have many objects.

2. Phong shading would have been a better objective. An object with flat shading requires a significantly large amount of faces to get a smooth surface, while an object with phong shading can have a much smoother surface with less faces. Therefore, the use of phong shading can both improve the quality and the performance of my raytracer.

3. The caustics photon map is not accurate enough, it introduces some artifacts around the edge of the shadow of the wine glass. More enhancements need to be made to the algorithm that estimates the irradiance. 

4. CSG vs. 3D modeling tool: Compared to a polygon mesh created by a 3D modeling tool, a CSG object can have smoother surfaces, and it is much cheaper to be raytraced, because it is treated as one piece of geometry, rather than thousands of polygons. However, sometimes CSG objects might look too “geometrically perfect” to be “photorealistic”. It can also be difficult to build complicated shapes using the CSG technique.

5. A kd-tree data structure is highly desirable for the photon map.  

======================================================================================

Special Thanks

Professor Stephen Mann, Marta Kryven, and Egor Larionov: For all the insightful advice, inspiring encouragement, and generous help.

甄姐姐: For pointing out that the surface normal should be flipped after the light enters another medium.

甦神: For making me feel very regretful for not having phong shading implemented.   

Comfy Lounge: For providing me with a place to sleep.

游小跳 and Kai: For feeding me.