Visualization of acceleration structures (or: obtaining the acceleration structures from optix)

I am still a beginner with optix and when learning about other structures, visualization often was crucial. Beyond that, when updating the scene, I would like to see whether the update was correctly performed on the acceleration structure as well, see e.g. https://devtalk.nvidia.com/default/topic/1057063/optix/animations-in-optix-6-previously-performed-using-selectors-/post/5361980/#5361980.

Thus, I would like to retrieve the acceleration structures from optix and visualize them. Is that possible?

I have been going back to forum entries of one year and could not find the information. For those interested, a few references:

From the forum
I see that the Acceleration getData and setData methods are getting depreciated. I’m trying to serialize an acceleration structure so I can save it / re-use it

The serialized data returned by rtAccelerationGetData is intended to be an opaque data blob. You would not be able to parse or deconstruct it
https://devtalk.nvidia.com/default/topic/1017362/optix/acceleration-getdata-and-setdata/

I’d like to ask if it is possible to access actual built BVH structures - we’re thinking about saving and loading these for our scenes and also visualize them
https://devtalk.nvidia.com/default/topic/1038334/optix/accessing-bvh-structure/post/5275626/#5275626

From the documentation
https://raytracing-docs.nvidia.com/optix_6_0/guide_6_0/index.html#host#acceleration-structures
No information about getting the actual information from the acceleration structures, only about setting it.

https://raytracing-docs.nvidia.com/optix_6_0/api_6_0/html/optix__host_8h.html#a1467743288cbbadfc5c43e496a876d28
opaque type to handle Acceleration Structures - Note that the *_api type should never be used directly

We’re considering adding a tool to OptiX for visualizing accels, but currently it doesn’t exist.

I’d like to ask if it is possible to access actual built BVH structures - we’re thinking about saving and loading these for our scenes and also visualize them

You can somewhat visualize your accels already using high performance timers. Check out the optixMotionBlur sample, and hit the ‘t’ key, you’ll see an x-ray of the BVH. If you look at the code, you’ll see this is implemented by timing the raygen program.

You cannot retrieve the accel structure data from OptiX currently. That could change in the future, but even if it did, there’s very little point because building an accel is much faster than transfering it from disk. It will not save you time to serialize them or save them, it will only make things much slower.


David.

For me the main point is not to get the acceleration structures fast, but to see whether what I am doing is right, i.e. it is rather about debugging, visualizing and understanding. But I see your point about the sense of doing so.

Nice, I will try that out, thank you for your help!