upward auto-exposure / eye-adaptation glsl shader SDR (temporal stable) #18119
Replies: 2 comments 6 replies
-
|
I don't know if you checked the 2nd file I sent but you'll probably want to have separate speeds or logic for dark to scenes with bright areas (that may still be partially a dark scene) so it doesn't flashbang you. |
Beta Was this translation helpful? Give feedback.
-
|
This uses 16x16 points of the image to calculate average brightness, which is insufficient. Secondly, I don't believe real-time measurement solutions can truly eliminate flicker. A feasible approach is to convert the video to HDR as is, then use a solution like Dolby Vision/HDR10+ to generate dynamic metadata, ensuring the generated metadata is smooth, merging it into the HDR version of the video, and finally playing it using HDR-Toys. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First of all a big shout out to Jules-A, he gave the tip that storing history in a user shader was actually possible, without it there would be no stability in the image.
After searching for an "auto-exposure / eye-adaptation" glsl shader here finally is one for SDR. This shader only brightens the image, it doesn't darken it. But you can expand it and add features on top of it.
You get two shaders. One main shader, and the 2nd one is the same but with added meter/stats (overlay at the top of the screen), so you can actually see what is happening under the hood. This will make it easier to set it up to your liking.
Enjoy it, have fun :)
Meter/Stats:
Green Bar=raw avg brightness input

Yellow Bar=how much of the effect is applied
Keybind (input config):
toggle shaders on/ff
here you can control the value of
EFFECT_STARTfrom 0.5 to 1, this can be applied to the other variables (this is a template)Config:
Speed of adaptation (lower value=slower, higher value=faster)
(line 107)
float alpha = 0.005;Strength of brightening effect (Max Exposure)
(line 64)
#define MAX_EV 1.5At which point effect starts brightening
(line 51 - EFFECT_START)
0.9At which point effect reaches maximum
(line 67)
#define EFFECT_FULL 0.20Performance:
How many samples taken for averaging frame brightness
(line 17)
const int N = 16;You can increase that number (32, 64 etc.) to get more accurate results, but keep in mind that a higher value can decrease performance depending on your specs/machine/current load
Installation:
2a. run always via mpv config "MPV\portable_config\mpv.conf" (Don't run both at once)
2b. or keybind via input config "MPV\portable_config\input.conf"
Invert Shader/"Night mode" (Bonus):
This can help in specific conditions like Night Vision or very bright skies


off
on (invert-hard)
Download GLSL Shader:
Update: added 2 invert shaders
auto_exposure has now a more finetuned look
shader.zip
old:
auto_exposure.zip
auto_exposure3 (no stats)
auto_exposure2 (with stats/meter)
Beta Was this translation helpful? Give feedback.
All reactions