Closed natural-harmonia-gropius closed 1 year ago
At this point, why not just estimate the histogram in your own shader?
How to do it? Not familiar with glsl ......
I don't know how to port this to mpv shader
https://www.shadertoy.com/view/3dBXRW
piecewise_dyna.glsl It works. But
samples
Err, no, that's completely not the way to do it. You need to use a compute shader, have each work group compute a local histogram then write that (using atomic integer addition) to a shader storage buffer shared between all work groups. (This also needs to be initialized to 0 by an earlier pass)
And then you can evaluate its result, preferably also in a separate sub-pass done only once, and generate your LUT which you can sample from a later pass.
Expected behavior of the wanted feature
I'm using custom shaders for tone mapping. https://github.com/mpv-player/mpv/pull/10827 gives the ability to change parameters at runtime. I want to go further to get the exact luminance informations of frame to control the
shoulderStrength
.This is the position I want it to work.