What do people use nowadays to calculate the average luminance for an image (e.g. for use with tonemapping)?
Right now I'm just generating the mips for a luminance map of my scene, starting from whatever the image resolution is. Most of the time those are non-power-of-2 resolutions, so I guess the results could get a bit funky. Indeed I sometimes notice very different behavior for different resolutions that I cannot account to anything else.
One approach that I have seen is to render the luminance map into a square, power-of-2 target before generating the mips. But won't the average luminance be too high in that case, if the original image has a common 16/10 or 16/9 ratio? Could this error be minimized by using a 2/1 luminance map?
Or is it better to simply calculate the average in one step (e.g. with a GPGPU-API)?