summaryrefslogtreecommitdiff
path: root/shader.frag
diff options
context:
space:
mode:
Diffstat (limited to 'shader.frag')
-rw-r--r--shader.frag19
1 files changed, 13 insertions, 6 deletions
diff --git a/shader.frag b/shader.frag
index 2084f1c..53db428 100644
--- a/shader.frag
+++ b/shader.frag
@@ -1,3 +1,4 @@
+#version 330 core
#ifdef GL_ES
precision mediump float;
#endif
@@ -7,9 +8,10 @@ uniform float time;
uniform float m;
//uniform sampler2D backbuffer;
-uniform sampler2D image1;
-uniform sampler2D image2;
-uniform sampler2D image3;
+uniform sampler2D img0;
+uniform sampler2D img1;
+uniform sampler2D img2;
+uniform sampler2D img3;
//uniform vec2 u_tex0Resolution;
float random (in float x) {
@@ -18,8 +20,13 @@ float random (in float x) {
void main (void) {
vec2 st = gl_FragCoord.xy/resolution.xy;
- vec4 i1 = texture2D(image1,st*0.8);
- vec4 i2 = texture2D(image2,st);
- gl_FragColor = mix(i1,i2,m);
+ vec4 i1 = texture2D(img0,st*0.8);
+ vec4 i2 = texture2D(img1,st);
+ vec4 i3 = texture2D(img2,st*1.2);
+ vec4 i4 = texture2D(img3,st);
+ i1 = mix(i1,i2,sin(time));
+ i2 = mix(i3,i4,cos(time));
+ //gl_FragColor = mix(i1,i2,0.5);
+ gl_FragColor = i1;
//gl_FragColor = texture2D(image1,st*sin(time*2.));
}