Do not allow specvalue to be below 0.

Just in case it shouldnt be possible anyway.
This commit is contained in:
Vincent Lejeune 2014-09-15 01:06:15 +02:00
parent 0d982e55f0
commit 6b4430caaa

View File

@ -14,6 +14,6 @@ vec3 getLightFactor(float specMapValue)
vec3 DiffuseComponent = texture(DiffuseMap, tc).xyz;
vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
float ao = texture(SSAO, tc).x;
vec3 tmp = DiffuseComponent + SpecularComponent * specMapValue;
vec3 tmp = DiffuseComponent + SpecularComponent * max(specMapValue, 0.);
return tmp * ao;
}