Homework 2 - Part 1: Bounding Volume Hierarchy

In the first part of the second assignment, we are expected to introduce Bounding Volume Hierarchy as an acceleration structure. Bounding Volume Hierarchy lets us traverse scene objects in logarithmic time on average. 

In my  implementation, scene has a BVH for the all meshes, primitive triangles, and spheres according to their axis aligned bounding boxes. Also all meshes have each their BVH according to all the triangles that form the mesh. For generating BVH, I split bounding box from the middle of the current dimension. I alternate the dimension in the order x->y->z for each level.
Scene consists of:
- 1 Mesh(4978 Triangles)
Before BVH:
rendering on #8 thread(s)
bunny.png(512x512) is saved in: 6 seconds 717 milliseconds 342 microseconds
After BVH:
rendering on #8 thread(s)
bunny.png(512x512) is saved in: 42 milliseconds 690 microseconds


Scene consists of:
- 2 Spheres
- 5 Meshes, each one has 2 Triangles
Before BVH:
rendering on #8 thread(s)
cornellbox.png(800x800) is saved in: 81 milliseconds 689 microseconds
After BVH:
rendering on #8 thread(s)
cornellbox.png(800x800) is saved in: 111 milliseconds 785 microseconds


Scene consists of:
- 1 Mesh ( 871414 Triangles)
Before BVH:
rendering on #8 thread(s)
chinese_dragon.png(800x800) is saved in: 55 minutes 19 seconds 937 milliseconds 285 microseconds
After BVH:
rendering on #8 thread(s)
chinese_dragon.png(800x800) is saved in: 222 milliseconds 699 microseconds

For the Scenes that have a few objects, BVH didn't help. But for the Scenes that have a lot of objects, BVH accelerated the rendering significantly. 


Specifications:


Yorumlar

Yorum Gönder

Bu blogdaki popüler yayınlar

Homework 3 - Transformations, Instancing, Distribution Ray Tracing

Homework 7 - Object Lights, Spherical Environment Mapping, Path Tracing

Homework 4 - All About Textures (Textures, Perlin Texture, Bump Mapping)