Acceleration Structures

Warning

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.

Warning

The backward pass for BVH is currently broken

RayTracer.AccelerationStructureType
AccelerationStructure

Base 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.

source
RayTracer.BVHNodeType
BVHNode

A node in the graph created from the scene list using BoundingVolumeHierarchy.

Fields:

  • x_min - Minimum x-value for the bounding box
  • x_max - Maximum x-value for the bounding box
  • y_min - Minimum y-value for the bounding box
  • y_max - Maximum y-value for the bounding box
  • z_min - Minimum z-value for the bounding box
  • z_max - Maximum z-value for the bounding box
  • index_start - Starting triangle in the scene list
  • index_end - Last triangle in the scene list
  • left_child - Can be nothing or another BVHNode
  • right_child - Can be nothing or another BVHNode
source
RayTracer.BoundingVolumeHierarchyType
BoundingVolumeHierarchy

An 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 order
  • root_node - Root BVHNode

Constructors:

  • BoundingVolumeHierarchy(scene::Vector)
source