Benchmarking: count actual hit rays, and relative hit rays

Related thread about counting rays here, basically the same thing drwootton explained, I would just hold and increment the counters on the per-ray payload and write once at the end of the ray generation program.
https://forums.developer.nvidia.com/t/optix-7-and-msvs-2017-hello-world-on-windows-10/141711/9

I would use += 1 to increment that counter. It’s CUDA C++ after all. :-)

But due to the motion, as I am watching some black pixels, I assume I will receive less rays than the original number.

The Cornell Box scene inside the optixPathTracer is open in the front. Of course not all rays will have two bounces then. All rays leaving the box through the open front will reach the miss shader which is black and if you’re not implementing direct lighting or the surface hit was in shadow during direct lighting, there will not be any additional radiance from that path. That’s what progressive Monte Carlo path tracing algorithms always look like.

Note that there was a bug in older optixPathTracer versions, handling emissions incorrectly. OptiX SDK 7.5.0 contains a fix.
https://forums.developer.nvidia.com/t/trivial-bug-i-guess/196124

1 Like