Code: Select all
return pow(c, BrightnessThreshold);
If I get what you are trying to do, isn't that unnecessary for a properly configured ENB? If the preset is set up right, then things will have their proper intensities set and everything that should trigger ALF will do so with pixel luminance. If not, leaving the choice to an algorithm is not gonna solve it really, unless you always want something triggering ALF. If you are switching to a "dark scene threshold" anyway, then that's mostly a more convoluted way of having only bright things trigger it, which is what pixel luminance does but without the need to sample and with a smoother curve than what you currently have I think. Especially if you are going to be skipping pixels for your samples, that may not work so well as I understand it. I think there is a way to gain performance for what you are doing by downsampling your texture before fetching the average, though. Maybe this page has info about 1/3 of the way down? http://content.gpwiki.org/D3DBook:High- ... _Rendering