aboutsummaryrefslogtreecommitdiffstats
path: root/Shaders
diff options
context:
space:
mode:
Diffstat (limited to 'Shaders')
-rw-r--r--Shaders/ui.frag16
-rw-r--r--Shaders/ui.vert19
2 files changed, 35 insertions, 0 deletions
diff --git a/Shaders/ui.frag b/Shaders/ui.frag
new file mode 100644
index 0000000..118108c
--- /dev/null
+++ b/Shaders/ui.frag
@@ -0,0 +1,16 @@
+#version 130
+
+uniform sampler2D sampler;
+
+in vec2 texCoord;
+in vec4 color;
+
+out vec4 FragColor;
+
+void main(){
+ vec4 pixelColor = texture2D(sampler, vec2(texCoord.x, texCoord.y));
+ //TODO allow antialiasing
+ //if (pixelColor.w != 1.0f)
+ // discard;
+ FragColor = pixelColor * color;
+}
diff --git a/Shaders/ui.vert b/Shaders/ui.vert
new file mode 100644
index 0000000..ee4f92c
--- /dev/null
+++ b/Shaders/ui.vert
@@ -0,0 +1,19 @@
+#version 130
+
+in vec3 coord2d;
+in vec2 tex_coord;
+
+uniform mat4 projection;
+uniform mat4 view;
+uniform mat4 model;
+
+out vec2 texCoord;
+out vec4 color;
+
+void main(){
+ texCoord = tex_coord;
+ color = vec4(1.0, 1.0, 1.0, 1.0);
+ //color = tex_color;
+ //gl_Position = ortho * vec4(coord2d.xyz, 1.0);
+ gl_Position = projection * view * model * vec4(coord2d, 1.0f);
+}