Project 5.Required image:![]() This is the chocolate bunny rendered with the GriddedGroup. Render time was 2 seconds. Code listing:Program 5 tarredDesign Choices:With the grid, I chose to allocate all of the memory at once. I did this because I wanted it to go faster. I chose not to use the intersects method because I tried it for the triangles, and it didn't work for me. I would've had to have found a way that worked better. So, I just left it out because I decided that I was less likely to use other primitives such as spheres all of the time. If that chages, I'll just have to uncomment a few lines and add the appropriate code into the sphere class.Creative Image:![]() This is the bullet with radius of 0.0005. Time it took:The grid took me a bit longer than the BVH, but my BVH runs pretty slowly. I'd say the BVH took me around 5 hours, but I could be way off. The grid took me a little longer because I had to find a bug.Difficulty:To get something to work slowly is easier than to get it to work as fast as it should. The grid worked pretty well. The BVH, however, didn't run as fast. It could just be a poorer implementation of it.Extra Credit:I implemented the BVH with the Weghorst BVH construction. The fastest I could get it to render with the bunny is about 7.71 seconds. With the grid, it rendered in around 2 seconds. The differences in time could be due to incorrect interpretation of the surface area heuristic, an unoptimized version of it, or a completely unbalanced tree (which is what I suspect it to be). With the bullet, the time differences were a lot larger. The gridded group with no scaling factor (otherwise I run out of memory), took 2.95 seconds to render. The BVH took 561 seconds. |