Welcome, Guest.
Username: Password: Remember me

TOPIC: "Luminance consideration" for vignette

"Luminance consideration" for vignette 1 year 5 months ago #1

  • Ederer
  • Ederer's Avatar
  • Offline
  • Posts: 9
  • Thank you received: 3
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: 20 hours 30 minutes ago by Ederer.
The administrator has disabled public write access.
The following user(s) said Thank You: MaxG3D, BillyAlt, jas01

"Luminance consideration" for vignette 1 year 5 months ago #2

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.


Witanlore: Dreamtime
The administrator has disabled public write access.
The following user(s) said Thank You: Ederer