summaryrefslogtreecommitdiffhomepage
path: root/src/shaders/default.frag
diff options
context:
space:
mode:
Diffstat (limited to 'src/shaders/default.frag')
-rw-r--r--src/shaders/default.frag19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/shaders/default.frag b/src/shaders/default.frag
index 241369e..2ad6732 100644
--- a/src/shaders/default.frag
+++ b/src/shaders/default.frag
@@ -1,16 +1,21 @@
#version 330 core
out vec4 FragColor;
-in vec3 ourColor;
-in vec2 TexCoord;
+in vec4 v_Color;
+in vec2 v_TexCoord;
+in float v_TexId;
-uniform sampler2D texture1;
-//uniform sampler2D texture2;
+uniform sampler2D texture_1;
void main()
{
- vec2 texInvert = vec2(TexCoord.x, -TexCoord.y);
- FragColor = texture(texture1, texInvert);// * ourColor;
- //FragColor = texture(ourTexture, TexCoord) * vec4(ourColor.xyz, 1.0);
+ if(v_TexId > 0)
+ {
+ FragColor = texture(texture_1, v_TexCoord) * v_Color;
+ }
+ else
+ {
+ FragColor = v_Color;
+ }
}