mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
23 lines
494 B
GLSL
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);
|
|
}
|
|
}
|