summaryrefslogtreecommitdiff
path: root/src/render/shaders/glsl/sdr_mod.glsl
blob: 7803d804a679197f82fed731f81ca256ec1f8b16 (plain)
1
2
3
4
5
6
7
8
9
10
uniform float sdrSaturation;
uniform float sdrBrightnessMultiplier;

vec4 saturate(vec4 color, mat3 primaries, float saturation) {
    if (saturation == 1.0)
        return color;
    vec3 brightness = vec3(primaries[1][0], primaries[1][1], primaries[1][2]);
    float Y = dot(color.rgb, brightness);
    return vec4(mix(vec3(Y), color.rgb, saturation), color[3]);
}