From 67101ac60fb41dc9ed94855ae7b71568620dbd05 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 20 Jul 2017 19:16:09 +0200 Subject: uthash removed --- shader.frag | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'shader.frag') 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; } -- cgit v1.2.3