#version 120
varying float light;
uniform vec4 color;
uniform float ambientLight;
uniform float intensity;

void main() {
	float lightValue = min(1.0, ambientLight + max(0.0, intensity * light));
	gl_FragColor = vec4(color.r * lightValue * color.a, color.g * lightValue * color.a, color.b * lightValue * color.a, color.a);
}