Lecture #14: Acceleration structures

Computer graphics in Game development

Ivan Belyavtsev

22.02.2020

Bounding volume

From: https://flylib.com/books/en/2.124.1.130/1/

Axis-aligned bounding boxes

From: https://3dengine.org/Bounding_volume/

Box intersection algorithm

float3 invRaydir = float3(1.0) / ray.direction;
float3 t0 = (aabb_max - ray.position) * invRaydir;
float3 t1 = (aabb_min - ray.position) * invRaydir;
float3 tmin = min(t0, t1);
float3 tmax = max(t0, t1);
return maxelem(tmin) <= minelem(tmax);

[1]

“AABB” experiment

TODO

  • Group traingles to objects
  • Compute axis-aligned bounding boxes
  • Change intersection flow to use AABBs

“AABB” experiment

Reference

From: https://github.com/djbelyak/rt-template/blob/master/references/aabb.png

“AABB” experiment

What is the new knowledge?

Traversing AABB before internal triangles gives a good speed up

Bounding volume hierarchy

  • Top-level accelleration structures (TLAS)
  • Bottom-level accellecration structures (BLAS)

“BVH” experiment

TODO

  • Implement two-level AS
  • Implement traversal of the BVH

“BVH” experiment

Reference

From: https://github.com/djbelyak/rt-template/blob/master/references/bvh.png

“BVH” experiment

What is the new knowledge?

  • BVH don’t speed up a Cornell box

References

1. McGuire M. The graphics codex. 2.14 ed. Casual Effects, 2018.