"Luminance consideration" for vignette

More
5 years 3 months ago - 3 years 9 months ago #1 by Ederer
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
Last edit: 3 years 9 months ago by Ederer.
The following user(s) said Thank You: MaxG3D, BillyAlt, jas01

Please Log in or Create an account to join the conversation.

More
5 years 3 months ago #2 by vfxninjaeditor
Replied by vfxninjaeditor on topic "Luminance consideration" for vignette
This is in fact how a camera lens works (and many vignette effects you can apply in photo software, like Adobe Lightroom, also have highlight control) The grayed brights that happen with the current vignette looks terrible and are the only thing that stops me from using the effect.
The following user(s) said Thank You: Ederer

Please Log in or Create an account to join the conversation.