Pulse Multitouch

http://kineme.net/composition/gtoledo3/PulseMultitouchoriginallybyDanguaferSilexarsportedtoworkwithMultitouch




This is Pulse by Danguafer/Silexars(2010) from the ShaderToy collection, changed to work with multitouch.

http://kineme.net/release/MultitouchPatch/10  (patch dl)


The original fragment code is below:


//Pulse by Danguafer/Silexars(2010)
uniform float time;
uniform vec2 resolution;
//uniform vec4 mouse;
uniform float x1;
uniform float y1;
uniform float s1;
uniform float x2;
uniform float y2;
uniform float s2;
uniform float x3;
uniform float y3;
uniform float s3;
uniform float x4;
uniform float y4;
uniform float s4;
uniform float x5;
uniform float y5;
uniform float s5;
uniform float x6;
uniform float y6;
uniform float s6;
uniform float x7;
uniform float y7;
uniform float s7;
uniform float x8;
uniform float y8;
uniform float s8;
uniform float x9;
uniform float y9;
uniform float s9;
uniform float x10;
uniform float y10;
uniform float s10;
uniform float x11;
uniform float y11;
uniform float s11;

uniform sampler2D tex0;

void main(void)
{
    vec2 halfres = resolution.xy/2.0;
    vec2 cPos1 = gl_FragCoord.xy;
cPos1.x -= x1;
cPos1.y -= y1;
    float cLength1 = length(cPos1);
    vec2 cPos2 = gl_FragCoord.xy;
cPos2.x -= x2;
cPos2.y -= y2;
    float cLength2 = length(cPos2);
    vec2 cPos3 = gl_FragCoord.xy;
cPos3.x -= x3;
cPos3.y -= y3;
    float cLength3 = length(cPos3);
     vec2 cPos4 = gl_FragCoord.xy;
cPos4.x -= x4;
cPos4.y -= y4;
    float cLength4 = length(cPos4);
    vec2 cPos5 = gl_FragCoord.xy;
cPos5.x -= x5;
cPos5.y -= y5;
    float cLength5 = length(cPos5);
    vec2 cPos6 = gl_FragCoord.xy;
cPos4.x -= x6;
cPos4.y -= y6;
    float cLength6 = length(cPos6);
    vec2 cPos7 = gl_FragCoord.xy;
cPos7.x -= x7;
cPos7.y -= y7;
    float cLength7 = length(cPos7);
vec2 cPos8 = gl_FragCoord.xy;
cPos8.x -= x8;
cPos8.y -= y8;
    float cLength8 = length(cPos8);
    vec2 cPos9 = gl_FragCoord.xy;
cPos9.x -= x9;
cPos9.y -= y9;
    float cLength9 = length(cPos9);
    vec2 cPos10 = gl_FragCoord.xy;
cPos4.x -= x10;
cPos4.y -= y10;
    float cLength10 = length(cPos10);
    vec2 cPos11 = gl_FragCoord.xy;
cPos11.x -= x11;
cPos11.y -= y11;
    float cLength11 = length(cPos11);

    vec2 uv = (gl_FragCoord.xy/resolution.xy+((cPos1/cLength1)*sin(cLength1/30.0-time*10.0)/25.0))
    +(gl_FragCoord.xy/resolution.xy+((cPos2/cLength2)*sin(cLength2/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos3/cLength3)*sin(cLength3/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos4/cLength4)*sin(cLength4/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos5/cLength5)*sin(cLength5/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos6/cLength6)*sin(cLength6/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos7/cLength7)*sin(cLength7/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos8/cLength8)*sin(cLength8/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos9/cLength9)*sin(cLength9/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos10/cLength10)*sin(cLength10/30.0-time*10.0)/25.0));
    +(gl_FragCoord.xy/resolution.xy+((cPos11/cLength11)*sin(cLength11/30.0-time*10.0)/25.0));


    vec3 col = texture2D(tex0,uv).xyz*(s1/cLength1+s2/cLength2+s3/cLength3+s4/cLength4+s5/cLength5+s6/cLength6+s7/cLength7+s8/cLength8+s9/cLength9+s10/cLength10+s11/cLength11);

    gl_FragColor = vec4(col,1.0);
}