ghostty/shaders/cell.f.glsl
2022-04-18 17:57:08 -07:00

20 lines
381 B
GLSL

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