
// pass this color from your material color as a uniform later on...
uniform vec4 matColor;

varying vec3 v_Normal;

void main()
{
	///////////////////////////////////////////////////////////////////////
	vec3 viewDir = vec3(0.934935,0.340287,0.0);	// "light" fixed from the right, 20 degrees slightly up
	vec3 normal = gl_NormalMatrix * v_Normal;

	// extend from -1.1 to 0,1 to have full range even in non lit area
	float cpdot = dot(normal,viewDir)*0.5 + 0.5;
	
//	cpdot = clamp(1.2*pow(cpdot, 2.0)-0.1,0.0,1.0);

	vec4 finalColor;
	// best guess for a cooler and warmer color
	vec3 CoolColor = matColor.rgb*vec3(0.55, 0.6, 0.65);
	vec3 WarmColor = matColor.rgb*vec3(1.25, 1.2, 1.15);

	finalColor.rgb = mix(CoolColor, WarmColor, cpdot);

	gl_FragColor = finalColor;
	///////////////////////////////////////////////////////////////////////
}