kitty/kitty/bgimage_fragment.glsl
2020-02-02 11:45:48 +05:30

16 lines
374 B
GLSL

#version GLSL_VERSION
uniform sampler2D image;
uniform float opacity;
uniform float premult;
in vec2 texcoord;
out vec4 color;
void main() {
color = texture(image, texcoord);
float alpha = color.a * opacity;
vec4 premult_color = vec4(color.rgb * alpha, alpha);
color = vec4(color.rgb, alpha);
color = premult * premult_color + (1 - premult) * color;
}