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_vert.glsl
parent2fe7e70e928a80276bb4fbcfa9f32419d6c4baa7 (diff)
BLF/OpenGL: draw text with new immediate mode
Part of T49043
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_text_vert.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_text_vert.glsl24
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl
index bdbffdfcf51..44568f28c8e 100644
--- a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl
@@ -1,20 +1,24 @@
-// TODO(merwin):
-// - uniform color, not per vertex
-// - generic attrib inputs (2D pos, tex coord)
+uniform mat4 ModelViewProjectionMatrix;
#if __VERSION__ == 120
- flat varying vec4 color;
- noperspective varying vec2 texcoord;
+ attribute vec2 pos;
+ attribute vec2 texCoord;
+ attribute vec4 color;
+ flat varying vec4 color_flat;
+ noperspective varying vec2 texCoord_interp;
#else
- flat out vec4 color;
- noperspective out vec2 texcoord;
+ in vec2 pos;
+ in vec2 texCoord;
+ in vec4 color;
+ flat out vec4 color_flat;
+ noperspective out vec2 texCoord_interp;
#endif
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);
- color = gl_Color;
- texcoord = gl_MultiTexCoord0.st;
+ color_flat = color;
+ texCoord_interp = texCoord;
}