Monday, September 26, 2011

Assignment #3 - Acceleration Data Structure

This week we're building some structure and functionality to make our ray-tracing faster.  The recommended approach is the bounding volume hierarchy, which I've been thinking through the past few days.

In order to motivate this work, we were first recommended to see how bad things currently are, by making a scene with a lot of objects and using our existing code to trace it.  I took my previous assignment and added some recursive code to generate a "sphereflake", then set the recursion level to 5 and tried it out.  Here's the result, an interesting image:


And here is the timing information:

Number of geometric objects: 937
Raytraced image in 33987103 microseconds

So that's almost 34 seconds to ray-trace 937 spheres with 1 light and 3 levels of recursive light bounce allowed.  I should probably add another light to the opposite side of the scene so I can see some of those spheres better, and this will also increase the tracing time.

So there's the motivation: see how much better we can do rendering 937 spheres. If the spheres were instead triangles, I'd expect a lot more savings from a hierarchy of axis-aligned minimum bounding boxes, but hopefully I'll see some benefit anyway.

No comments:

Post a Comment