summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-12-12 16:12:01 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-12 16:12:01 +0000
commit6c268e0f98722c3253366b639a3a0abe37c8835d (patch)
tree409376e0b302009d29ed27dcb4601f037f377e6f /gfx/gl/shaders
parentMove program handle to its own files (diff)
downloadilt-6c268e0f98722c3253366b639a3a0abe37c8835d.tar.bz2
ilt-6c268e0f98722c3253366b639a3a0abe37c8835d.tar.xz
ilt-6c268e0f98722c3253366b639a3a0abe37c8835d.zip
Introduce the UI shader
Diffstat (limited to 'gfx/gl/shaders')
-rw-r--r--gfx/gl/shaders/uiShader.fs11
-rw-r--r--gfx/gl/shaders/uiShader.vs13
2 files changed, 24 insertions, 0 deletions
diff --git a/gfx/gl/shaders/uiShader.fs b/gfx/gl/shaders/uiShader.fs
new file mode 100644
index 0000000..907c4f1
--- /dev/null
+++ b/gfx/gl/shaders/uiShader.fs
@@ -0,0 +1,11 @@
+#version 130
+
+in vec2 texCoord0;
+
+uniform sampler2D sampler;
+
+void
+main()
+{
+ gl_FragColor = texture(sampler, texCoord0);
+}
diff --git a/gfx/gl/shaders/uiShader.vs b/gfx/gl/shaders/uiShader.vs
new file mode 100644
index 0000000..0d00fed
--- /dev/null
+++ b/gfx/gl/shaders/uiShader.vs
@@ -0,0 +1,13 @@
+#version 130
+
+in vec4 position;
+
+out vec2 texCoord0;
+uniform mat4 uiProjection;
+
+void
+main()
+{
+ gl_Position = uiProjection * vec4(position.xy, 0.0, 1.0);
+ texCoord0 = position.zw;
+}