aboutsummaryrefslogtreecommitdiffstats
path: root/Shaders
diff options
context:
space:
mode:
Diffstat (limited to 'Shaders')
-rw-r--r--Shaders/ui.frag10
-rw-r--r--Shaders/ui.vert21
2 files changed, 20 insertions, 11 deletions
diff --git a/Shaders/ui.frag b/Shaders/ui.frag
index 737344e..118108c 100644
--- a/Shaders/ui.frag
+++ b/Shaders/ui.frag
@@ -1,12 +1,16 @@
+#version 130
+
uniform sampler2D sampler;
-varying vec2 texCoord;
-varying vec4 color;
+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;
- gl_FragColor = pixelColor * color;
+ FragColor = pixelColor * color;
}
diff --git a/Shaders/ui.vert b/Shaders/ui.vert
index b2fcba4..ee4f92c 100644
--- a/Shaders/ui.vert
+++ b/Shaders/ui.vert
@@ -1,14 +1,19 @@
-attribute vec3 coord2d;
-attribute vec2 tex_coord;
+#version 130
-uniform mat4 ortho;
-uniform vec4 tex_color;
+in vec3 coord2d;
+in vec2 tex_coord;
-varying vec2 texCoord;
-varying vec4 color;
+uniform mat4 projection;
+uniform mat4 view;
+uniform mat4 model;
+
+out vec2 texCoord;
+out vec4 color;
void main(){
texCoord = tex_coord;
- color = tex_color;
- gl_Position = ortho * vec4(coord2d.xyz, 1.0);
+ 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);
}