summaryrefslogtreecommitdiff
path: root/data/graphics/shaders/simple_frag.glsl
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-11 23:44:25 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-12 00:47:24 +0300
commit8e1fc2522ee907da5fc3e65691990fd608539a72 (patch)
tree888bdab76dc75120a68c4213c204d0ce13da6f61 /data/graphics/shaders/simple_frag.glsl
parent41836760fa59abc74098aed7450b4858dc288e56 (diff)
downloadmanaplus-8e1fc2522ee907da5fc3e65691990fd608539a72.tar.gz
manaplus-8e1fc2522ee907da5fc3e65691990fd608539a72.tar.bz2
manaplus-8e1fc2522ee907da5fc3e65691990fd608539a72.tar.xz
manaplus-8e1fc2522ee907da5fc3e65691990fd608539a72.zip
Use only one shader program for all drawing.
Diffstat (limited to 'data/graphics/shaders/simple_frag.glsl')
-rw-r--r--data/graphics/shaders/simple_frag.glsl11
1 files changed, 10 insertions, 1 deletions
diff --git a/data/graphics/shaders/simple_frag.glsl b/data/graphics/shaders/simple_frag.glsl
index 02fbf5519..45c1ddd73 100644
--- a/data/graphics/shaders/simple_frag.glsl
+++ b/data/graphics/shaders/simple_frag.glsl
@@ -1,7 +1,16 @@
#version 150 core
+in vec2 Texcoord;
out vec4 outColor;
+uniform sampler2D tex;
uniform vec4 color;
+uniform float drawType;
+uniform float alpha;
+
void main()
{
- outColor = color;
+ outColor = texture(tex, Texcoord);
+ if (drawType >= 0.1)
+ outColor = texture(tex, Texcoord) * vec4(1.0, 1.0, 1.0, alpha);
+ else
+ outColor = color;
}