#version 120
uniform sampler2D iChannel0;

uniform vec4 lightColor;
uniform vec4 darkColor;

uniform float left;
uniform float right;

//const float fadeDistance = 12.0;

#include "shaders/logic.glsl"

void main()
{
	vec4 c = texture2D(iChannel0, gl_TexCoord[0].xy);
	
	gl_FragColor = mix(darkColor,lightColor,c.r)*c.a*gl_Color;
	gl_FragColor *= ge(gl_FragCoord.x,left)*le(gl_FragCoord.x,right);
	//gl_FragColor *= clamp(1.0 - (left - gl_FragCoord.x)/fadeDistance,0.0,1.0)*clamp(1.0 - (gl_FragCoord.x - right)/fadeDistance,0.0,1.0);
}