preventing bounding boxes from clipping through nearer goemetries

Please correct me if an assumption I have made is incorrect, or if I have missed something. When OptiX is traversing the BVH, it determines the geometry for which the ray intersects the geometry’s AABB. It then calls the geometry intersection function to see if there truly is an intersection between the ray and the geometry itself. This causes an issue when the geometry does not completely fill its bounding box.

The example is when a sphere and box are near each other and their bounding boxes overlap. If the box geometry is outside of the sphere but contained in the sphere’s AABB, then the box will not show up in front of the sphere even when it should. (See the attachment for a clearer example where the box should be seen by the center ray but is not).

Is there a way around this issue, or is this something inherent in the BVH algorithm?

Hi @amelmquist,

There aren’t any correctness problems with overlapping AABBs. For rays that intersect both of them, OptiX will traverse into both of them, run both intersection programs, and then return the intersection that is closer to the ray’s origin.

Are you having a problem intersecting overlapping objects?


David.

David, thank you for the quick response and the correction/clarification on the intersection algorithm functionality. I am seeing an issue with this, but based on what you have pointed out, perhaps this is an issue with my implementation. A quick check with the tutorial shows this functionality working fine with a box and parallelogram, so I’ll look into it further. Thank you very much for your help!