James Bigler: CS6620 Homework 4




Implement grid based volume heirarchy, and compare the rendering rates with that of a bounding volume heirarchy on several different models.

Talking with Pete, we decided that I could try implementing a BSP (Binary Splitting Tree) instead of a Grid. My implementation devides space into two, then seperates all the geometry into the two halves. Geometries that span both regions are put into both. This can cause many duplicate hits if the same piece of geometry ends up in both sides of the tree. To help alleviate this problem, one can specify the min number of objects in a node. This way the subdivision stops at that level rather than trying to divide the geometry further. As well a maximum tree depth is usefull to make sure the recursion stops and you don't explode with memory.



All images are 500x500 and include shadows. Timing was done on an Origin 3k with R12k (400Mhz) processors.



Galleon

This object has 4690 smooth triangles

Click for a larger
view of galleon

BSP

DepthMin Objs Per NodeNumber of NodesBuild TimeRender Time
2051086571.95 sec.57.5 sec.
2010603291.34 sec.52.3 sec.
2510102731222.9 sec.93.5 sec.
151069840.22 sec.36.0 sec.
10106840.076 sec.59.2 sec.
131029690.14 sec.38.4 sec.
141046090.17 sec.37.4 sec.
13533180.14 sec.38.3 sec.
14555050.18 sec.37.1 sec.

It seems there is an optimal configuration where you ballance the number of nodes and the number of objects at the leaves. The general winner is the one where you get the Number of nodes to be about equivalent to the number of primitives.

BVH

Number of NodesBuild TimeRender Time
52830.038 sec.22.2 sec.

Here without any parameter tweaking, BVH's results were far superior to BSP's.



Million Spheres

Click for a larger
view of million

BSP

DepthMin Objs Per NodeNumber of NodesBuild TimeRender Time
20103677318.5 sec.131.6 sec.
30 (only hit 27)1045750725.4 sec.68.7 sec.
305108399630.6 sec.67.2 sec.
35 (only hit 34)5108406230.5 sec.67.1 sec.

Going off my previous subposition that the number of nodes needed to be similar to the number of objects I picked configurations that would give me those numbers. I managed to only sqeeze a runtime of about 67 seconds. This beats BVH, but the memory is much more (473 MB for BSP, and 378MB for BVH). With the wrong parameters BSP's memory could get much worse unlike BVH.

BVH

Number of NodesBuild TimeRender Time
104857519.2 sec.74.7 sec.

Here without any parameter tweaking, BVH's results were similar to BSP's.



Chess Pawn

In this scene there is a triangle mesh with 8512 polygons. What makes this scene different from the Galleon is the floor underneath. There are two triangles making up the floor whose dividing line goes directly underneath the model. This has a tendency to screw up BSPs. The image you see has one bounce indirect lighting and 100 samples per pixel. Simulations were run without indirect lighting and only one sample per pixel.

Click for a larger
view of pawn

BSP

DepthMin Objs Per NodeNumber of NodesBuild TimeRender Time
15103340.15 sec.37.8 sec.
201024160.23 sec.16.8 sec.
2510117170.40 sec.15.2 sec.
3010188190.52 sec.15.1 sec.
3510300390.73 sec.15.1 sec.

Well, the best time seemed to peak out around the point where we see the number of nodes equal the number of primitives. Increasing parameters to increase the number of nodes did not show much improvement, and of course consumes more memory.

BVH

Number of NodesBuild TimeRender Time
88370.071 sec.26.7 sec.

Here without any parameter tweaking, BVH's results were on the same order of magnitude, but about 60 percent slower. I didn't have tweak the values though.



Conclusion

While there are some models and some situations where BSP won over BVH in regards to to render speed, BVH has consistantly shown performance on the same order of magnitude. BVH is more stable in the sense that it does not require any parameter tweaks as does BSP's. In order for BSPs to perform well, paramters must be adjusted by the user until the number of nodes in the tree equals approximately the number of primitives. This is could possibly be automated, but why bother when BVHs can do about as good and often beter job with out this tuning.
Conclusion: BVH RULES!