summaryrefslogtreecommitdiff
path: root/shader.frag
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2017-07-20 19:16:09 +0200
committerChristoph Helma <helma@in-silico.ch>2017-07-20 19:16:09 +0200
commit67101ac60fb41dc9ed94855ae7b71568620dbd05 (patch)
tree0234b975e3297fe84bdafaaa854f363474d36635 /shader.frag
parentf664a085f271eb318e8c89d49fc3f9c0f61f2440 (diff)
uthash removed
Diffstat (limited to 'shader.frag')
-rw-r--r--shader.frag35
1 files changed, 20 insertions, 15 deletions
diff --git a/shader.frag b/shader.frag
index 71a7141..0494364 100644
--- a/shader.frag
+++ b/shader.frag
@@ -8,14 +8,19 @@ uniform float time;
uniform float m;
//uniform sampler2D backbuffer;
-uniform sampler2D img0;
-uniform sampler2D img1;
-uniform sampler2D img2;
-uniform sampler2D img3;
-uniform float img0ratio;
-uniform float img1ratio;
-uniform float img2ratio;
-uniform float img3ratio;
+uniform sampler2D i0;
+uniform sampler2D i1;
+uniform sampler2D i2;
+uniform sampler2D i3;
+uniform float i0ratio;
+uniform float i1ratio;
+uniform float i2ratio;
+uniform float i3ratio;
+
+uniform float p0;
+uniform float p1;
+uniform float p3;
+uniform float p4;
out vec4 fragColor;
float random (in float x) {
@@ -24,12 +29,12 @@ float random (in float x) {
void main (void) {
vec2 st = gl_FragCoord.xy/resolution.xy;
- vec4 i1 = texture2D(img0,st*vec2(img0ratio,1.));
- vec4 i2 = texture2D(img1,st*vec2(img1ratio,1.));
- vec4 i3 = texture2D(img2,st*vec2(img2ratio,1.));
- vec4 i4 = texture2D(img3,st*vec2(img3ratio,1.));
- i1 = mix(i1,i2,sin(time));
- i2 = mix(i3,i4,cos(time));
- fragColor = mix(i1,i2,0.5);
+ vec4 img1 = texture2D(i0,st*vec2(i0ratio,1.));
+ vec4 img2 = texture2D(i1,st*vec2(i1ratio,1.));
+ vec4 img3 = texture2D(i2,st*vec2(i2ratio,1.));
+ vec4 img4 = texture2D(i3,st*vec2(i3ratio,1.));
+ img1 = mix(img1,img2,sin(time));
+ img2 = mix(img3,img4,cos(time));
+ fragColor = mix(img1,img2,p0);
//gl_FragColor = i1;
}