I am currently writing a simple OptiX program with a few Geometries. One Geometry is 50%transparant and emits some light. The other only emits light. Right now I need a closest hit program for each Geometry. I would however like to make one closest hit program for each Material.
Which means: if I would like a Geometry to emit light, I simple add the light emitting material (=closest hit program). If I also want it to be transparant, I add that material too. Now this means that after my rtPotentialIntersection() I need this:
rtReportIntersection(0);
rtReportIntersection(1);
However this doesn’t work. The variables changed in the closest hit program on index 0, are not seen in the closest hit program at index 1. So it only executes the second rule.
Is there any way in which I can add multiple closest hit programs on a geometry and call them after each other?