Wendy Chen
Advising Professor: Holly Rushmeier
Fall 2015
Abstract:
The focus of this CPSC 290 project was to add further modifications to a raytracer base, namely, to implement an acceleration structure. I chose to implement a hierarchal axis-aligned bounding box system, partitioning space using a k-d tree.
Unaccelerated raytracing shoots a ray through each pixel and iterates through all objects in the scene, checking for the closest object intersected by the ray. However, each pixel does not necessarily contain an object, and complicated scenes can contain thousands of objects, so the process of iterating through all objects per pixel becomes slow very quickly. To accelerate the process, we would like to reduce how many intersections between the ray and objects we check for at each pixel. By subdividing the space into bounding boxes, we can assign an appropriate list of objects found in each bounding box. Thus, for each ray shot through each pixel, we first traverse the bounding boxes and check if they contain objects. If the bounding box intersected by the ray doesn’t contain any objects, we can quickly move on to the next pixel. If the bounding box does contain objects, we can check the list of objects contained in the bounding box instead of the list of objects contained in the entire scene.
In addition to supporting acceleration, my code supports complex geometries and shading for additional materials, like glass. In order to support OBJ file importation, I wrote a Python script to parse OBJ files taken from Blender into a JavaScript-friendly format. In order to support glass materials, I modified the code to account for ray refraction. Caustics, however, are not accounted for.
Links: