diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-10-11 21:36:16 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-10-11 21:36:16 +0300 |
commit | 53d82c3e8d608bc05e40e26950a98d15b16c562c (patch) | |
tree | 0690b828537db41ce10453875f6d3e6eee6aadd2 /source/blender/gpu/shaders/gpu_shader_text_vert.glsl | |
parent | 2fe7e70e928a80276bb4fbcfa9f32419d6c4baa7 (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.glsl | 24 |
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; } |