HW 5 - Efficiency structures
2-9-98

In this assignment, we try to speed up ray tracing by reducing the number of intersection checks we have to make for each ray. I chose the uniform grid data structure . The grid has the following characteristics:-
Let N = the number of objects
del_x * del_y *del_z: the dimensions of each square od the grid
n_x * n_y * n_z: the total number of grids.

Then the following properties are satisfied:-

I was planning to store the intersection of a ray with an object so that the intersection of each object with a particular ray is not calculated more than once. However in this assignment, the small radius of the spheres guarantees that each sphere can span not more than 4 grid boxes.  So it would deteriorate the performance.


I used the UNIX 'time' command to measure the execution time of the process.  I ran the process on Jacoby (MIPS R4400 with 128 Meg memory). Here are the results
 
Number of Spheres (N) Pre-processing time (seconds) Ray tracing time (seconds) Total time (seconds)
1 negligible 1.0 1.0
10 negligible 2.6 2.6
100 negligible 4.9 4.9
1,000 negligible 7.9 7.9
10,000 0.1 13.1 13.2
100,000 2.6 25.1 29.1
1,000,000 26.277 110.900 127.177



Here are the images generated
 
N=1 
N=10
N=100 
N=1,000
N=10,000 
N=100,000
N=1,000,000