Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2016-10-11 21:36:16 +0300
committerMike Erwin <significant.bit@gmail.com>2016-10-11 21:36:16 +0300
commit53d82c3e8d608bc05e40e26950a98d15b16c562c (patch)
tree0690b828537db41ce10453875f6d3e6eee6aadd2 /source/blender/gpu/shaders/gpu_shader_text_frag.glsl
parent2fe7e70e928a80276bb4fbcfa9f32419d6c4baa7 (diff)
BLF/OpenGL: draw text with new immediate mode
Part of T49043
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_text_frag.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_text_frag.glsl13
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl
index c169b315c24..9283d682767 100644
--- a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl
@@ -1,12 +1,13 @@
#if __VERSION__ == 120
- flat varying vec4 color;
- noperspective varying vec2 texcoord;
+ flat varying vec4 color_flat;
+ noperspective varying vec2 texCoord_interp;
#define fragColor gl_FragColor
#else
- flat in vec4 color;
- noperspective in vec2 texcoord;
+ flat in vec4 color_flat;
+ noperspective in vec2 texCoord_interp;
out vec4 fragColor;
+ #define texture2D texture
#endif
uniform sampler2D glyph;
@@ -14,8 +15,8 @@ uniform sampler2D glyph;
void main()
{
// input color replaces texture color
- fragColor.rgb = color.rgb;
+ fragColor.rgb = color_flat.rgb;
// modulate input alpha & texture alpha
- fragColor.a = color.a * texture2D(glyph, texcoord).a;
+ fragColor.a = color_flat.a * texture2D(glyph, texCoord_interp).a;
}