first build attempt
This commit is contained in:
20
build/shaders/text.frag
Normal file
20
build/shaders/text.frag
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
Reference in New Issue
Block a user