CS 6620 Project 4: Uniform Grids Ray Tracer

Feb 6, 2002


Top Previous Next


Uniform Grids is implemented. As we are using Object-orient design, this new implement, though time-consuming on debugging especially for the loop control, is quite straight forward, and actually require no changes to the BVH raytracer. I only need to write another class for Grids and Grid, implement their Hit(), and instead of creating BVHNode (a subtype of Surface) and pass the pointer to the Surface* member of the World object, now I just create Grids(also subtype of Surface).

The tests are carried out at the same machine. This time the BVH CPU time is a bit longer than the previous tests, perhaps because I changed the BBox::Hit(..double &tmin, double &tmax..) to BBox::Hit(..double tmin, double tmax..). However, the exact reason of this CPU change is not clear: address vs. double argu space? or change tmin and/or tmax will make later Hit() more efficient(which I realy dont think so)?

However, there is one significant conclusion based on the comparsion: uniform grids is more efficient(except the 10 sphers and 100 spheres), and most remarkably scales far better than BVH.

For the current uniform grids method, I do not cache the result of ray-object intersection. As one object may occupy simultaneously in more than one grids, caching will probably make it more efficient.

Here is the detailed output of unix time command.





g++ compiler On SGI workstation IRIX 6.5, 270MHz CPU, 256M main memory + 32K DataCache + 32K InsCache

10 spheres 100 spheres 1000 spheres 10,000 spheres 100,000 spheres 1,000,000 spheres
BVH 2.115 seconds 4.842 seconds 11.493 seconds 27.759 seconds 76.398 seconds 424.933 seconds
UniGrids 2.386 seconds 3.871 seconds 6.705 seconds 13.894 seconds 33.164 seconds 138.729 seconds
10 spheres, click to enlarge 100 spheres, click to enlarge 1000 spheres, click to enlarge 10,000 spheres, click to enlarge 100,000 spheres, click to enlarge 1000,000 spheres, click to enlarge