Face access for ray generation

This is one of the more often discussed questions on this forum.
The sampling issue of the geometry positions is similar to a direct lighting implementation for arbitrary mesh lights which I have implemented inside my open-source OptiX examples.
The connection to the single point of light is then simply a fast visibilty/shadow ray test and the fastest method for that is also shown inside my examples.

Please read these threads where I described multiple ways to handle that:

This explains the fastest visibility ray implementation:
(Actually there is also another fast method using the Shader Execution Reordering optixTraverse call shown inside the OptiX SDK optixPathTracer example. I would try that only after the above method works.)

Find the example code here:
Look at the newest example rtigo12 for the arbitrary mesh and point light sampling and the fastest shadow ray implementation.