Acceleration Structures
This is a Beta Feature and not all things work with this.
Bounding Volume Hierarchy
Bounding Volume Hierarchy (or BVH) acts like a primitive object, just like Triangle or Sphere. So we can simply pass a BVH object into raytrace function.
The backward pass for BVH is currently broken
RayTracer.AccelerationStructure — TypeAccelerationStructureBase Type for all Acceleration Structures. These can be used to speed up rendering by a significant amount. The main design behind an acceleration structure should be such that it can be used as a simple replacement for a vector of Objects.
RayTracer.BVHNode — TypeBVHNodeA node in the graph created from the scene list using BoundingVolumeHierarchy.
Fields:
x_min- Minimum x-value for the bounding boxx_max- Maximum x-value for the bounding boxy_min- Minimum y-value for the bounding boxy_max- Maximum y-value for the bounding boxz_min- Minimum z-value for the bounding boxz_max- Maximum z-value for the bounding boxindex_start- Starting triangle in the scene listindex_end- Last triangle in the scene listleft_child- Can benothingor anotherBVHNoderight_child- Can benothingor anotherBVHNode
RayTracer.BoundingVolumeHierarchy — TypeBoundingVolumeHierarchyAn AccelerationStructure which constructs bounding boxes around groups of triangles to speed up intersection checking. A detailed description of ths technique is present here.
Fields:
scene_list- The scene list passed into the BVH constructor but in sorted orderroot_node- RootBVHNode
Constructors:
BoundingVolumeHierarchy(scene::Vector)