#version 330 core

in vec2 texCoord;
in vec4 vertexFragColor;
out vec4 fragColor;
uniform sampler2D texture0;
uniform vec4 color = vec4(1);
uniform float time = 1.0;
uniform float time2 = 1.0;

float rand(vec2 coord)
{
    return fract(sin(dot(coord.st,vec2(12.9898,78.233)+time)) * 43758.5453);
}

float getRandomNoise(vec2 coord)
{
    return rand(coord);
}


void main()
{
    vec2 coord=texCoord;
    //coord.t*=-1;
    //coord.s += sin(coord.t*4 + time*5)*0.1;
    //coord.t += cos(coord.s*3 + time*8)*0.1;
    //coord.s = mod(coord.s+time,1.0);
    coord.s = coord.s+time2;

    vec4 color1 = color;
    vec4 scrollColor = texture2D(texture0, coord) * color1;

    fragColor = scrollColor;
}
