Open animuspix opened 2 months ago
Should review BVH setup code (+ layout in PIX) before getting stuck into the traversal shader properly, here.
Had a minor epiphany about this today and realized I could create a bottom-up volume hierarchy (not sure if it's technically a BVH or not) out of spheres, starting by grouping pairs (or more) triangles together under one sphere, then grouping pairs (or more) of spheres together under larger spheres, and so on. Instead of navigating a grid (the current system is a fake BVH, it's actually an octree), traversal would mean digging through children and jumping just past the edge of the current bounding sphere if none of them intersect.
I think this proposed algorithm will still require an emulated stack/history buffer for handling cases where only some children intersect, but I might need to work through it on paper to make sure - either way, quite keen to investigate it this week, I've felt stuck in sludge with the octree approach for a while.
Current algorithm seems to work for testing the scene AABB, but breaks down when navigating child nodes; need to keep iterating until I reach something more scalable, A simpler algorithm than what I'm currently using would be a good bonus ^_^'