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

uniform highp float iTime;

const highp vec3 W = vec3(0.2125, 0.7154, 0.0721);

void main() {
    highp vec2 uv = textureCoordinate;

    highp float t = mod(iTime * 2.8 * 4.0,2.8);


    if (t < 2.0) {
        highp float d = (1.0 - abs(t - 1.0)) * 0.025;

        //重影
        highp vec4 c0 = texture2D(inputImageTexture,uv);
        highp vec4 c1 = texture2D(inputImageTexture,uv + vec2(d,0.0));
        highp vec4 c2 = texture2D(inputImageTexture,uv - vec2(d,0.0));
        highp vec4 c3 = texture2D(inputImageTexture,uv + vec2(2.0*d,0.0));
        highp vec4 c4 = texture2D(inputImageTexture,uv - vec2(2.0*d,0.0));
        gl_FragColor = mix(mix(mix(mix(c0,c1,0.5),c2,1.0/3.0),c3,1.0/4.0),c4,1.0/5.0);

        //黑白
        highp float luminance = dot(gl_FragColor.rgb, W);
        gl_FragColor = vec4(vec3(luminance), gl_FragColor.a);
    } else {
        gl_FragColor = texture2D(inputImageTexture,uv);
    }
}