BVH (WebGPU required!)

This is a variation over Zero-Byte-BVH.
We implement axis-aligned bounding boxes hierarchy at no cost by reordering the triangles by group of 6, each group defining a bounding box (with the min/max coordinates of each of the 18 vertices).


Triangles are pre-sorted by group of 6: such a group defines a bounding-box if you sort the vertices' coordinates along x/y/z. This bounding box can be cached or pre-calculated (see the 'Optimized BVH' method).
The shader will launch a ray for each pixel to recursively test the bounding boxes. If a box is hit by the ray, the remaining triangles a split in two exact halves and thus generate two new boxes to test, etc. until we hit a leaf.
If you don't cache the bounding boxes corresponding to a group of 6 triangles, this BVH is for free in memory space. The hierarchy is hard-coded within the triangles ordering.