uniform sampler2D baseMap;
uniform sampler2D noiseMap;
uniform float random;
uniform float Time;
varying vec2 Texcoord;

void main(void)
{
   vec4 base = texture2D( baseMap, Texcoord );
   
   //film noise
   vec2 noiseUV = Texcoord * 5.0;
   noiseUV.x += random;
   noiseUV.y += 1.0 - random * random;
   float noise = texture2D(noiseMap, noiseUV).z;
   
   
   //scanlines
   float scanline = (Texcoord.y - Time * 0.002) * 250.0;
   scanline = clamp(pow(mod(scanline, 2.0), 10.0), 0.0, 1.0);
   
   vec4 finalColor = base * (1.0 - scanline * 0.1);//base * (1.0 - noise * 0.3) * (1.0 - scanline * 0.1);
   finalColor.a = 1.0;
   gl_FragColor = finalColor;
}