I’m using the custom primitive intersection and would like to reuse the BVH to calculate which AABBs contain a certain point for a separate calculation. Are there any calls in Optix that do this? Ideally I would like to iterate over these.
All I can think of is setting up a custom intersection program that accumulates stuff in the intersection program, but I’m not certain that the intersection program is called once per an AABB. Another approach would be to reuse the BVH in a different pipeline that has a custom intersection that always returns true, then accumulate within the anyhit. Are either of these viable options?
You definitely could use an intersection program that returns true. In order to guarantee only a single hit, you can use OPTIX_GEOMETRY_FLAG_REQUIRE_SINGLE_ANYHIT_CALL
.
–
David.