diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_text_frag.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_text_frag.glsl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl new file mode 100644 index 00000000000..e0a19912520 --- /dev/null +++ b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl @@ -0,0 +1,22 @@ + +#if __VERSION__ == 120 + flat varying vec4 color_flat; + noperspective varying vec2 texCoord_interp; + #define fragColor gl_FragColor +#else + flat in vec4 color_flat; + noperspective in vec2 texCoord_interp; + out vec4 fragColor; + #define texture2D texture +#endif + +uniform sampler2D glyph; + +void main() +{ + // input color replaces texture color + fragColor.rgb = color_flat.rgb; + + // modulate input alpha & texture alpha + fragColor.a = color_flat.a * texture2D(glyph, texCoord_interp).r; +} |