The following scenes were used to test this structure: For testing purposes, N spheres were created centered at ( drand48()*2-1,drand48()*2-1,drand48()*2-1) and a radius of 0.1/(N^0.3333 ). I think that ths scene does not reflect the performance of individual efficiency schemes, so be careful interpreting the results. In addition, shading and lighting were turned off to speed up the raytracing time.
I ran the test program on R8000 with dual FP unit and 128 Mb of RAM. As it turned out, my raytracer was not particulary suited for these tests, because some features I have implemented slow it down (bigger memory consumption due: each object has name, transformation matrix, inverse transformation matrix, ray ID, etc. ).
2. Grid
I implemented adaptive grid as described by Jevans and Wyvill
(ie if number of objects in a voxel exceeds some threshold, subdivide the
voxel). Adaptive grid option was not used due to the bug in my code. There
is more room for improvement especially in voxel traversal scheme.
| Num Spheres | Preprocess time | Trace time | Total time |
| 1 | small | 10.34 s | 10.34 s |
| 10 | small | 13.15 s | 13.15 s |
| 100 | small | 17.76 s | 17.76 s |
| 1000 | small | 24.92 s | 24.92 s |
| 10000 | 0.2 s | 32.73 s | 32.93 s |
| 100000 | 3.12 s | 44.59 s | 47.71 s |
| 1000000 | 16.43 s | 119.1 s | 135.53 s |
3. Bounding Volume Hierarchy
I implemented automiatic bounding volume hierarchy creation scheme
as described by Goldsmith and Salmon. Whene there were large number of
objects in the scene, I was unable to experiment with the number of tries
hierarchy was generated due to poor implmentation on my part (ie I ran
out of memory, because I kept too many object lists around).
| Num Spheres | Preprocess time | Trace time | Total time |
| 1 | 0 s | 8.3 s | 8.3 s |
| 10 | 0.8 s | 12.53 s | 13.33 s |
| 100 | 1.4 s | 14.2 s | 15.6 s |
| 1000 | 7.4 s | 21.21 s | 28.61 s |
| 10000 | 20.3 s | 38.2 s | 58.5 s |
| 100000 | 164.6 s | 49.69 s | 214.29 s |
| 1000000 | 613 s | 107.4 s | 720.4 s |
4. BSP Tree
BSP tree is another space subdivision acceleration scheme. I have implemented
hybrid method: build hierarchical bounding volume structure to some degree
then partition it and build a BSP tree.
I have not been able to test this method yet.
5. Conclusion
Efficiency structures reduce the ray tracing time dramatically.
Grid efficiency scheme was the fastest for THIS PARTICULAR SCENE,
using my own implementation. It does not mean that it will outperform other
schemes for different scenes and different raytracers. I need to run more
experiements on more realistic scenes to determine the performance.
6. References
1. Glassner A., An Introduction To Ray Tracing, pp. 202-262, 1989
2. Goldsmith, J., and Salmon, J., Automatic creation of object hierarchies
for ray tracing, IEEE Comput. Graph. Appl. 7(5), 14-20, May 1987
3. Snyder, J.M. and Barr, A.H., Ray tracing complex models containing
surface tesselations, Siggraph Proceedings 1987, 45-54, July 1987
4. Fujimoto, A. et al., ARTS: Accelerated Ray-Tracing System. IEEE
Comput. Graph Appl. 6(4), 16-26, April 1986
5. Jevans, D. and Wyvill, B., Adaptive Voxel Subdivision for Ray Tracing,
Graphics Interface '89, 164-172, 1989
6. Woo, A. and Amanatides, J., Voxel Occlussion Testing: A Shadow Determination
Accelerator for Ray Tracing, Graphics Interface 1990, 213-220, 1990