Hi,
would it be a good idea to implement a "luminance consideration" option, just like martys SSAO has?
it would help to "simulate" a 32bit hdr input, in which the sun would be brighter than 1 and not turn grey when a vignette is applied.
here is what i tried. i have no idea about programming, so i looked at the SSAO code and tried to adapt it to the vignette.h
i changed the line
colorInput.rgb *= (1.0 + pow(distance, VignetteSlope * 0.5) * VignetteAmount ); //pow - multiply
to
colorInput.rgb *= (1.0 + pow(distance, VignetteSlope * 0.5) * (VignetteAmount * (1 - smoothstep(0.8, 1.0, colorInput.rgb)) ) ); //pow - multiply
and here is the result:
original, no vignette
vignette, look at the grey and washed out sun
vignette, with luminance consideration
-> the sun is still bright. in reality, the sun would probably "shrink" a bit as well, because of the border becoming less bright (at least i think so...
), but i guess this is impossible to achieve...
it's just a suggestion, but maybe it would be useful to have some settings for that included in the vignette effect...
EDIT: The darkened border seems to be a little oversaturated... If you don't like it, use this line instead. It now uses the luminace to mask the vignette:
colorInput.rgb *= (1.0 + pow(distance, VignetteSlope * 0.5) * (VignetteAmount * (1 - smoothstep(0.8, 1.0, ((colorInput.r + colorInput.g + colorInput.b) / 3) )) ) ); //pow - multiply