summaryrefslogtreecommitdiff
path: root/source/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'source/shaders')
-rw-r--r--source/shaders/ui_text_shader.fs.glsl12
-rw-r--r--source/shaders/ui_text_shader.vs.glsl12
2 files changed, 24 insertions, 0 deletions
diff --git a/source/shaders/ui_text_shader.fs.glsl b/source/shaders/ui_text_shader.fs.glsl
new file mode 100644
index 0000000..d8bdcfb
--- /dev/null
+++ b/source/shaders/ui_text_shader.fs.glsl
@@ -0,0 +1,12 @@
+#version 330 core
+
+in vec2 TexCoords;
+uniform sampler2D Texture;
+uniform vec3 TextColor;
+out vec4 FragColor;
+
+void main() {
+ vec4 sampled = vec4(1.0, 1.0, 1.0, texture(Texture, TexCoords));
+ FragColor = sampled * vec4(TextColor, 1.0);
+};
+
diff --git a/source/shaders/ui_text_shader.vs.glsl b/source/shaders/ui_text_shader.vs.glsl
new file mode 100644
index 0000000..ecaefa4
--- /dev/null
+++ b/source/shaders/ui_text_shader.vs.glsl
@@ -0,0 +1,12 @@
+#version 330 core
+layout(location=0) in vec3 aPos;
+layout(location=1) in vec2 aTex;
+
+uniform mat4 Projection;
+
+out vec2 TexCoords;
+
+void main() {
+ gl_Position = Projection * vec4(aPos, 1.0);
+ TexCoords = aTex;
+}