precision highp float;
#define iChannel0 inputImageTexture
#define texture(a,b) texture2D(a,fract(b))
#define fragColor gl_FragColor
varying highp vec2 textureCoordinate;
uniform sampler2D inputImageTexture;
uniform highp float iTime;
uniform highp vec2 iResolution;

uniform float amount;

const float PI = 3.1415927;

float rand(highp vec2 co) {
    return fract(sin(dot(co.xy ,vec2(12.9898,78.233)*3.141)) * 43758.5453);
}

void main()
{
    // Normalized pixel coordinates (from 0 to 1)
    highp vec2 uv = textureCoordinate;

    //float t = iMouse.x / iResolution.x * 10.0 - 5.0;
    float t = sin(iTime * 0.28) + cos(iTime * 0.52);
    t *= PI;

    //float amount = iMouse.x / iResolution.x * 0.1;
    highp vec2 d = vec2(amount * cos(t), amount * sin(t));


    float r = texture(iChannel0, uv - d).r;
    float g = texture(iChannel0, uv + 0.0).g;
    float b = texture(iChannel0, uv + d).b;

    fragColor = vec4(r,g,b,1.0);
}