/* * MIT License * Author: Mark Allyn * * text.frag — FreeType glyph-atlas fragment shader. * The atlas is a single-channel GL_RED texture; the sampled value * is used as alpha and multiplied by the text colour uniform. */ #version 330 core in vec2 vTexCoord; out vec4 fragColor; uniform sampler2D u_glyphAtlas; uniform vec3 u_textColor; void main() { float alpha = texture(u_glyphAtlas, vTexCoord).r; fragColor = vec4(u_textColor, alpha); }