#version 330 core
in vec2 vTex;
out vec4 FragColor;
uniform sampler2D iChannel0;
uniform vec3 iResolution;
uniform float iTime;
uniform float uAlpha;
uniform float uStartDelay;

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    float POWER = 0.04; // How much the effect can spread horizontally
    float VERTICAL_SPREAD = 7.0; // How vertically is the sin wave spread
    float ANIM_SPEED = 0.4;
    
    vec2 uv = fragCoord.xy / iResolution.xy;
    float y = (uv.y + iTime * ANIM_SPEED) * VERTICAL_SPREAD;
    
    uv.x += (
        sin(y)
        + sin(y * 10.0) * 0.2
        + sin(y * 50.0) * 0.03
    )
        * POWER
        * sin(uv.y * 3.141592653589793)
        * sin(iTime);
    
    fragColor = texture(iChannel0, uv);
}

void main(){ mainImage(FragColor, gl_FragCoord.xy); }
