#version 120
varying float light;
varying vec3 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.g * lightValue, color.b * lightValue, 1.0);
}