I'm trying to create a tone-mapping operator that changes on real time.
I have the LDR image (after apply the operator to the HDR image) on a spherical texture, on a sphere which always rotates about Y axis, and the camera is inside the sphere; here is an example:
I'm doing manual downsampling to calculate the log average luminance of the image, it works fine now.
Now, I want the operator to change on real time, so I want to calculate the log average luminance only for the portion of the image I'm seeing at each frame, to recalculate and change the operator effect on real time.
So, to do that, I need to know what coords of my texture are on screen at each frame, to select them and discard the others for downsampling.
Any help?