varying vec2 uv;
uniform float cycle;
uniform float offset;
uniform sampler2D texture;

//Note from Lucas:  "uv.x is related to distance from the source to the target, ranging from 0 to 1, but where 1 is the beam's maximum range"

void main() {
//	uv.x *= 2;
	vec3 sample = texture2D(texture,uv - vec2(cycle, 0.0)).rgb * (1.0 - uv.x);
	
	if(abs((uv.x + 1.0) - (mod(cycle + offset, 1.0) * 2.0)) < 0.3)
		sample *= 1.3;
//	else
//		sample *= 0.0;

	gl_FragColor.rgb = ((sample - vec3(0.5)) * 2.0 + gl_Color.rgb) * gl_Color.a;
	gl_FragColor.a = 0.0;
}
