I am currently working with very large triangle meshes. Until now, I’ve been using rtuCreateClusteredMeshExt(…) to internally format meshes for optimal paging performance.
The problem is that I need to track the id of the object to which an intersected triangle belongs. Currently I’m achieving this using separate material programs for each object in the scene, which are then called from the internal rtuCreateClusteredMeshExt(…) collision routine using the materialIndices argument (thank you for fixing this in Optix 3.0.1 btw!).
The problem is that there can be several thousand objects in a scene, and using a seperate material program for each object (where each program almost exactly the same thing) is causing significant warp divergance.
Is there another way to do this using rtuCreateClusteredMeshExt(…)? For example, is there a way to directly determine the primId of the intersected triangle found in rtuCreateClusteredMeshExt()?
If this is not possible, is there way to structure my mesh such that its corresponding acceleration structure (I’m using Lbvh) uses less memory? I’ve noticed a near order of magnitude difference in acceleration structure size when using my native meshes vs those produced with the clustered mesh routines.