Dont apply linear2srgb in borders with bg image as the cell shader doesnt apply it then either

This commit is contained in:
Kovid Goyal
2023-04-30 10:19:35 +05:30
parent bc2af4acf9
commit f6ccd2ad2c
2 changed files with 8 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
#version GLSL_VERSION
uniform uvec2 viewport;
uniform uint colors[9];
uniform float background_opacity;
uniform float background_opacity, do_srgb_correction;
uniform float tint_opacity, tint_premult;
uniform float gamma_lut[256];
in vec4 rect; // left, top, right, bottom
@@ -53,5 +53,6 @@ void main() {
color3 = is_window_bg * window_bg + (1. - is_window_bg) * color3;
float final_opacity = is_default_bg * tint_opacity + (1. - is_default_bg) * background_opacity;
float final_premult_opacity = is_default_bg * tint_premult + (1. - is_default_bg) * background_opacity;
color = vec4(color3 * final_premult_opacity, linear2srgb(final_opacity));
final_opacity = do_srgb_correction * linear2srgb(final_opacity) + (1. - do_srgb_correction) * final_opacity;
color = vec4(color3 * final_premult_opacity, final_opacity);
}