I am currently using Optix prime to iteratively trace rays through a structure. For example, I execute a closest hit query on a buffer of rays then take each hit in the buffer of hits and calculate the Cartesian coordinates from from the barycentric coordinates for the intersection point. I then launch a new batch of rays from those intersection points with the corresponding reflection directions. I run into a problem where some of the rays in the new batch of rays get “stuck” hitting the same triangle over and over. I believe this is a precision error with the conversion to the Cartesian coordinate system that I calculate and the ray ends up being slightly on the opposite side of the triangle face. I can remedy this by shifting the ray along the normal of the face so that the ray has no change of being on the wrong side.
I was wondering if there was an easier way to ignore the closest triangles so that the rays move through the triangles that are very close.
Thanks for you help!