this is a GPU LBVH builder implemented in slang-torch, based on Vulkan LBVH (Linear Bounding Volume Hierarchy)
I build every step in slangpy, so you can get any buffers in the BVH building process, for example, you can get the information of the bvh trees, so you can query on them in your own kernel, or do anything to them.
pip install torch, pyexr, slangpy, time, csv, numpy
run test.py
, which will let you know every step of building it.
and you will get a position map of a bunny.
simply querying the trees in kernel helps a lot, to get the position map of the bunny above, I compared with Triro, which uses NVIDIA OptiX to find intersections
GPU ray query time(test on RTX4090):
Triro : 0.015184 s
mine: 0.001178s