Digital Image Synthesis
Efficiency Structures
 
For my efficiency structure, I decided to implement a Bounding Volume Hierarchy. I did this by using Bounding Spheres (since I already had them implemented as primitives. I then created a procedural sphere field TAG in my scene file format, which built a group of spheres, that could or could not have a bounding volume for my tests. Here are the parameters and results of my tests with this structure.
 
All of my tests ran on my home Dual 350 MHz PII, with both threads running. I used Microsoft Visual C++ 6.0, SP2, with optimizations turned on. I ran all my images at 200 x 200, with 16 Samples Per pixel. The scene contained a single ground polygon (2 triangles), plus 2 light sources, and then the number of spheres given below, with the bounding volume
 
100 Spheres, 1 bounding volume
 
The first test that I ran was using 100 spheres with a single bounding volume containing all the spheres, so that rays would either hit or miss the volume. I figured that this would be a good base case test for this optimization. Here is the image, and the results.
 
 
With Bounding Volume = 30 seconds
 
Without Bounding Volume = 61 seconds.
 
 
1000 Spheres, 10 bounding volumes
 
The next test that I ran was to 10x increase my efforts to see what the results would be. I still kept things to a 1 bounding volume per 100 spheres. Here is the image and the results.
 
 
 
With Bounding Volume = 93 seconds
 
Without Bounding Volume = 654 seconds
 
Conclusion:
 
I concluded after running the 100 spheres test, that things would only begin to get worse and worse without using bounding volumes. I'm actually amazed that I didn't get this optimization finished earlier, since it made SO MUCH of a difference. It's very clear to me that it makes a huge difference to use bounding volumes. I've implemented this functionality into the core of my Ray Tracer, so that this optimization can now be done anywhere within my Ray tracer.