//The Bonk Light-Shader PIXEL

uniform sampler2D colorMap;
uniform vec4 ambientColor;

void main()
{
	//Uses color.r from texture as the alpha value 
	//This assumes all lights rendered as white, otherwise
	//I would have to average the color values or something.
	float alpha = texture2D(colorMap,gl_TexCoord[0].st).r;
	alpha = 1.0 - alpha;
	vec4 outColor = vec4(0.0, 0.0, 0.0, alpha );
	gl_FragColor = outColor * ambientColor;
}
