ghostty/shaders/cell.f.glsl
Mitchell Hashimoto c43c1d38f1 add background pass
2022-04-19 08:54:39 -07:00

23 lines
494 B
GLSL

#version 330 core
in vec2 glyph_tex_coords;
// The color for this cell. If this is a background pass this is the
// background color. Otherwise, this is the foreground color.
flat in vec4 color;
// Font texture
uniform sampler2D text;
// Background or foreground pass.
uniform int background;
void main() {
if (background == 1) {
gl_FragColor = color;
} else {
float a = texture(text, glyph_tex_coords).r;
gl_FragColor = vec4(color.rgb, color.a*a);
}
}