summaryrefslogtreecommitdiffhomepage
path: root/src/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/shaders')
-rw-r--r--src/shaders/default.frag9
-rw-r--r--src/shaders/default.vert7
2 files changed, 14 insertions, 2 deletions
diff --git a/src/shaders/default.frag b/src/shaders/default.frag
index 36ed030..17b84a0 100644
--- a/src/shaders/default.frag
+++ b/src/shaders/default.frag
@@ -1,9 +1,16 @@
#version 330 core
out vec4 FragColor;
+
in vec3 ourColor;
+in vec2 TexCoord;
+
+uniform sampler2D texture1;
+uniform sampler2D texture2;
void main()
{
- FragColor = vec4(ourColor, 1.0);
+ vec2 texInvert = vec2(TexCoord.x, -TexCoord.y);
+ FragColor = mix(texture(texture1, texInvert), texture(texture2, texInvert), 0.2);
+ //FragColor = texture(ourTexture, TexCoord) * vec4(ourColor.xyz, 1.0);
}
diff --git a/src/shaders/default.vert b/src/shaders/default.vert
index 2e9b994..5adf795 100644
--- a/src/shaders/default.vert
+++ b/src/shaders/default.vert
@@ -1,11 +1,16 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
+layout (location = 2) in vec2 aTexCoord;
+
+uniform float offset_x;
out vec3 ourColor;
+out vec2 TexCoord;
void main()
{
- gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);
+ gl_Position = vec4(aPos.x + offset_x, aPos.yz, 1.0);
ourColor = aColor;
+ TexCoord = aTexCoord;
}