in vec2 texCoord;
out vec4 fragColor;
uniform sampler2D texture0;
uniform float time;

uniform float amp;
uniform float freq;
uniform float scrollSpeed;
uniform float dir;

void main()
{
    vec2 uv = texCoord.st;

    float wave = sin(uv.y * freq + time * scrollSpeed) * amp;
    float waveCross = sin(uv.x * freq + time * scrollSpeed) * amp;

    uv.x += mix(wave, 0.0, dir);
    uv.y += mix(0.0, waveCross, dir);

    fragColor = vec4(texture(texture0, uv).rgb, 1.0);
}
