Fix #6224
This commit is contained in:
parent
8020d5823b
commit
07dbfaa297
@ -22,6 +22,14 @@ const uvec2 pos_map[] = uvec2[4](
|
|||||||
uvec2(LEFT, TOP)
|
uvec2(LEFT, TOP)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
float linear2srgb(float x) {
|
||||||
|
// Linear to sRGB conversion. Needed to match alpha from the cell shader
|
||||||
|
float lower = 12.92 * x;
|
||||||
|
float upper = 1.055 * pow(x, 1.0f / 2.4f) - 0.055f;
|
||||||
|
|
||||||
|
return mix(lower, upper, step(0.0031308f, x));
|
||||||
|
}
|
||||||
|
|
||||||
float to_color(uint c) {
|
float to_color(uint c) {
|
||||||
return gamma_lut[c & FF];
|
return gamma_lut[c & FF];
|
||||||
}
|
}
|
||||||
@ -45,5 +53,5 @@ void main() {
|
|||||||
color3 = is_window_bg * window_bg + (1. - is_window_bg) * color3;
|
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_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;
|
float final_premult_opacity = is_default_bg * tint_premult + (1. - is_default_bg) * background_opacity;
|
||||||
color = vec4(color3 * final_premult_opacity, final_opacity);
|
color = vec4(color3 * final_premult_opacity, linear2srgb(final_opacity));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user