summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/text.f.glsl11
-rw-r--r--res/text.v.glsl11
2 files changed, 22 insertions, 0 deletions
diff --git a/res/text.f.glsl b/res/text.f.glsl
new file mode 100644
index 00000000..32266b3e
--- /dev/null
+++ b/res/text.f.glsl
@@ -0,0 +1,11 @@
+#version 330 core
+in vec2 TexCoords;
+
+uniform sampler2D text;
+uniform vec3 textColor;
+
+void main()
+{
+ vec4 sampled = vec4(1.0, 1.0, 1.0, texture(text, TexCoords).r);
+ gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0) * sampled;
+}
diff --git a/res/text.v.glsl b/res/text.v.glsl
new file mode 100644
index 00000000..89bded5c
--- /dev/null
+++ b/res/text.v.glsl
@@ -0,0 +1,11 @@
+#version 330 core
+layout (location = 0) in vec4 vertex;
+out vec2 TexCoords;
+
+uniform mat4 projection;
+
+void main()
+{
+ gl_Position = projection * vec4(vertex.xy, 0.0, 1.0);
+ TexCoords = vertex.zw;
+}