From 6b4430caaaf5101ddd45158199e849a0ca930ee9 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 15 Sep 2014 01:06:15 +0200 Subject: [PATCH] Do not allow specvalue to be below 0. Just in case it shouldnt be possible anyway. --- data/shaders/utils/getLightFactor.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/shaders/utils/getLightFactor.frag b/data/shaders/utils/getLightFactor.frag index 9bf4cdf58..c17a3ca8b 100644 --- a/data/shaders/utils/getLightFactor.frag +++ b/data/shaders/utils/getLightFactor.frag @@ -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; } \ No newline at end of file