Last week I released on github a new single-header file library for constructing and traversing BVHs on the CPU, with (short-term) plans to take traversal (not construction) to the GPU as well.
Features:
* No dependencies at all. Just add the header to your project and it works.
* Simple interface. Build using a flat array of triangle vertices.
* Builds state-of-the-art SAH binned BVH using AVX - 34ms for 260k triangles.
* Or, ~250ms for the same data without AVX, for cross-platform purposes.
* Builds wide BVHs: 4-wide and 8-wide, also in GPU-friendly format.
* BVH refitting.
* BVH optimizing: post-process your static scene BVH for ~15% more speed.
* Comparison against Embree is included (not winning yet but closing in).
Coming up:
* CWBVH for billions of rays/second on the GPU.
* OpenCL examples.
* TLAS/BLAS traversal.
The code is an implementation and continuation of my articles on BVH construction.
Third episode of the Voxel Ray Tracing in C++ tutorial. Describes ray tracing techniques using a fast CPU template / framework. Covered so far: lights, shadows, reflection, refraction. Third article covers stochastic techniques: anti-aliasing and soft shadows, using temporal accumulation.
You mean it looks funny in Safari without that setting? I am learning a ton about wordpress caching plugins, after last night's HN deluge... Perhaps I can do a tutorial on that next. ;)
Well if you have more than 2 levels you can always collapse, which is the preferred solution. Just walk the scenegraph, and flatten the matrices. Now you're left with an array of BLASses, each with their final matrix.
RTX has hardware support for this flattened structure only; OptiX will become significantly slower if you force it to have more levels.
This is the sixth article on building a bounding volume hierarchy on the CPU, completing the original planned series.
Two more articles are now planned, taking this to the GPU, but still without using RTX.
Article 4 (on refitting) and 5 (constructing BLAS + TLAS) should arrive this week, completing the basic C++ implementation of the algorithm used for DXR / RTX.