I’m using optix to bake some texture data for a mesh. Therefore, I ray trace through each texel, intersect against the 2D texture geometry. Then pass the interpolated 3D position/normal to the “ClosestHit” program. In the closest hit program, I need to cast shadow rays. However, these shadow rays need to be cast against the 3D geometry (not the previous 2D texture geometry). Is there a way to specify a different intersection program be used in a call to rtTrace?
If it is not possible, I guess a workaround would be to create two copies of optix::Geometry, but with the different intersection programs (and also two rtObject nodes). Then specify the rtObject with the 3D mesh intersections for the shadow ray.