Hi,
[ figure 1 ]
My intention is to achieve figure1.
I want to find the indices of other triangles that are visible from within a triangle. (single object)
Initially, I thought that only one ray per pair of triangles would be sufficient.
It seems that there might be situations where triangles cannot be accurately identified.
I need advice on how to handle the following scenario:
==========================================
[ figure 2 ]
condition: TraceDepth is 1 and using only closest hit.

Emit a ray from the centroid of (a) to (b).
11) (a) → (b): hit 
Emit a ray from the centroid of (a) to (c).
21) (b) is hit first.
23) Since TraceDepth is 1, tracing terminates.
24) (a) → (c): miss 
Emit a ray from the centroid of (a) to (d).
31) (a) → (d): hit 
Emit a ray from the centroid of (a) to (e).
41) (d) is hit first.
42) Since TraceDepth is 1, tracing terminates.
44) (a) → (e): miss
==========================================
In the scenario above, I want 24) to be recorded as a miss ( (c) is obscured by (b) )
and 44) to be recorded as a hit ( (e) is not obscured by (d) ).
To achieve this, it seems that using only one ray per pair of triangles won’t be sufficient.
I would like to ask for advice on this.
It seems that I’ll need the barycentroids and positions of each triangle to set the ray origin and direction in the raygen function.
Can I pass this information as “launch parameters”? If so, I’m considering passing an array of triangle centroids and indices.
The orientation of the triangles is not of interest.
I’m assuming that the scene is convex in shape.
The number of triangles in the scene could increase, potentially reaching 100k or more.
Therefore, I might need to execute optixLaunch multiple times, as you suggested.
Can I use a loop statement to run optixLaunch multiple times?
Your responses have been immensely helpful to me.
Thank you.