diff options
Diffstat (limited to 'source/shaders/ui_text_shader.vs.glsl')
| -rw-r--r-- | source/shaders/ui_text_shader.vs.glsl | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/source/shaders/ui_text_shader.vs.glsl b/source/shaders/ui_text_shader.vs.glsl index ecaefa4..363833e 100644 --- a/source/shaders/ui_text_shader.vs.glsl +++ b/source/shaders/ui_text_shader.vs.glsl @@ -1,12 +1,15 @@  #version 330 core -layout(location=0) in vec3 aPos; -layout(location=1) in vec2 aTex; +layout(location=0) in vec2 aPos;  uniform mat4 Projection; - +uniform mat4 LetterTransforms[32];  out vec2 TexCoords; +flat out int Index;  void main() { -  gl_Position = Projection * vec4(aPos, 1.0); -  TexCoords = aTex; +  gl_Position = Projection * LetterTransforms[gl_InstanceID] * vec4(aPos, 0.0, 1.0); +  vec2 tex = aPos; +  TexCoords = tex; +  TexCoords.y = 1.0 - TexCoords.y; +  Index = gl_InstanceID;  }  | 
