#version 450 core

in vec2 texCoord;

out vec4 outColor;

uniform sampler2D t_texture;

uniform float g_glvel;
uniform float g_time;

float t = g_time;
float it = (int((t + .4*sin(t*0.3) + .2*sin(t*0.9)) * 2.)) * .5;

// outputs
out vec4 color;

float rand(vec2 co){
    return 2.*(fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453)-.5);
}

void main(){
    vec2 uv = texCoord + vec2(g_glvel*(rand(vec2(texCoord.y, it))), 0.);
    outColor = texture2D(t_texture, uv);
}
