AABB counterpart of optixGetTriangleVertexData

There are various method to fetch geo data for different geometry types, for example optixGetTriangleVertexData.

However I didn’t find any for AABB (CUSTOM_PRIMITIVES). I guess the customPrimitiveArray.aabbBuffers and numPrimitives should support multi AABB inside one GAS.

Then how do I fetch the index and AABB data in IS/CH/AH shader?

Hi @iaomw,

To index your primitive (or AABB) data in a shader program, use optixGetPrimitiveIndex.

It’s not common to need the AABB, but if you do, you can just expose a pointer to your AABB array in your shaders and use the primitive index to access it. This would be the same array of AABBs that you passed to optixAccelBuild. Any other primitive geometry data you can put in another buffer and index it similarly using the primitive index.


David.