summaryrefslogtreecommitdiff
path: root/source/shaders/ui_text.vs.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'source/shaders/ui_text.vs.glsl')
-rwxr-xr-xsource/shaders/ui_text.vs.glsl16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/shaders/ui_text.vs.glsl b/source/shaders/ui_text.vs.glsl
new file mode 100755
index 0000000..9bba904
--- /dev/null
+++ b/source/shaders/ui_text.vs.glsl
@@ -0,0 +1,16 @@
+#version 330 core
+layout(location=0) in vec2 aPos;
+
+uniform mat4 Projection;
+uniform mat4 View;
+uniform mat4 LetterTransforms[32];
+out vec2 TexCoords;
+flat out int Index;
+
+void main() {
+ gl_Position = Projection * View * LetterTransforms[gl_InstanceID] * vec4(aPos, 0.0, 1.0);
+ vec2 tex = aPos;
+ TexCoords = tex;
+ TexCoords.y = 1.0 - TexCoords.y;
+ Index = gl_InstanceID;
+}