rtAccelerationGetData in Optix 4.0


I am beginner using Optix. I want to avoid building de BHV every time I load the model, by cache acceleration structure alonside the model, as suggested in this presentation (page 19)


The idea is to use rtAccelerationGetData the first time the tree is build, and rtAccelerationSetData the following times, since the scene geometry is fixed (there is no animation or moving object).

The problem is rtAccelerationGetData always return 320 bytes header and it´s seems there is no tree information. Checking the manual I found rtAccelerationGetData was deprecated in optix 4.0.

Which function or alternative scheme should I use?


The rtAccelerationGetData/SetData functions are from a time when building a BVH took many seconds. That is no longer the case. Now you should just use the default “Trbvh” builder type, which builds in parallel on the device.

Thanks for your quick response.

I´m loading a scene made of 500.000 triangles, and it takes about 20 / 30 seconds to start. But, as you said, I could verify that the TRBVH builder is extremelly fast, so the bottle neck must be in other place.( I´m loading several textures and compute LOD mipmaping also).
Thanks again!

Yes, the Trbvh builder should handle 500k triangles in < 1 second for most hardware.

You might try timing the first OptiX launch (you can use sutil::currentTime() if nothing else). The first launch includes a JIT compile step, a BVH build step, and the frame render. That should at least rule out an OptiX overhead vs. other things like building mip levels.