natural-harmonia-gropius / hdr-toys

Componentized Rec.2100 to Rec.709 conversion shader for mpv-player, featuring dynamic curves and a uniform color space.
MIT License
119 stars 1 forks source link

A shader that perceptually adds bloom to visually make highlights brighter #19

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi, really nice shaders. I think it could be great to have a shader that would add some perceptual bloom to some bright parts of the image to visually make them brighter. I am not sure what should the parameters and the PSF be, however.

natural-harmonia-gropius commented 1 year ago

Bloom effect should be produced by the video itself. As an alternative, Abney effect already exists in chroma_correction and dynamic.

ghost commented 1 year ago

High quality lenses do not generally produce bloom by themselves unless pointed at a very bright object. However, you will see bloom in your eyes when watching a video shot with those lenses on a real bright HDR monitor. Adding bloom artificially by a shader could mimic that effect

natural-harmonia-gropius commented 1 year ago

I did a quick test, are you happy with the result? (ignore obvious artifacts)

image

image

ghost commented 1 year ago

Thanks for the testing. Judging by the mountain, it looks dreamy rather than realistic, perhaps the radius is too small?

natural-harmonia-gropius commented 1 year ago

https://youtu.be/nh3gqtbYRkM?t=115 The result of a real pro-mist filter can be this. as you said, it looks dreamy.

https://youtu.be/AIcUc5gogvM?t=325 And this, you can see how real filter has more information of scene.

ghost commented 1 year ago

Well, I think it could be more beneficial for the end result to try to mimic the eye rather than a lens filter (even though it already tries that) since we have HDR data and probably can tweak the bloom amount depending on L_HDR and L_SDR. The filter will give the output the same look regardless of its luminance, and compared to an eye it has too smooth bloom in my opinion (probably good for creative use though)

natural-harmonia-gropius commented 1 year ago

Honestly it's beyond my capabilities. Things are far more complicated than thought, I think this requires AI analysis and PBR simulation, since the luminance of videos is not the real physical luminance.

So, I close this issue.

ghost commented 1 year ago

Ok, no problem

Edit: created an upstream feature request: https://github.com/mpv-player/mpv/issues/11506