I think in your code the white point is an user option rather than being computed on the fly, is that right?
Yes, as I said, “it’s not actually looking at the contents of the image but just has some parameters”.
Inside my examples both the white point and the brightness GUI settings affect the white point.
If yes then my problem is how to efficiently apply the operator?
Could it be done during the kernel run(by using a second buffer) or has to be a post process ?
Have a search for parallel reduction kernel on the web.
The hits for that describe the basic idea of how to quickly sum values in a grid and how to write that in CUDA most efficiently.
There is also a thrust::reduce() function which does that. (Never used myself.)
That said, if you read the OptiX 7.2 Programming Guide link I posted above again, that doesn’t only link to the paper from Eric Reinhard, it also explains how the HDR intensity is calculated in OptiX using optixDenoiserComputeIntensity
There is also the optixDenoiserComputeAverageColor function in the programming guide chapter directly above it.