Hi OptiX team! My deepest respect to all you for OptiX ray tracing system! This is an amazing super great product! I worked on it shortly 10 years ago. How great is it now, I can’t believe!
Now it’s time for me to use OptiX from other side! :)
I need to make some dynamic acceleration tree where there are 2 levels of IASes and a bottom level of GAS. This is some object noise based instancing based on procedural distribution on top of surface with object randomization. The aabboxes are not are known.
So at each level of transition from top level IAS to some bottom level IAS I am going to inject a custom user primitive which has my needed functionality: it will perform some magic and dynamically select some of available OptixTraversableHandle and launch optixTrace within it. Based on the inner optixTrace result the ray will reportIntersection or not for the higher-level optixTrace. The ray itself will not change direction or origin. However I can do some clipping.
So the amount of nesting of optixTrace is 3. Only at very bottom it will use all RTX processing with bvh and triangles but this bottom-most level is rather small amount of data.
Will this construction be efficient? How large is the stack/var size for each nesting optixTrace? Is it a good practice? I haven’t yet tested. But originally I wanted to use native Optix multi-level IAS traversal but didn’t find how to inject own bits of computation at the stages when the ray transitions from one IAS to the child IAS.