Blender Internal: Fix for lamp option "Specular" not working when "Only Shadow" is...
authorIRIE Shinsuke <irieshinsuke@yahoo.co.jp>
Fri, 30 May 2014 13:11:06 +0000 (22:11 +0900)
committerIRIE Shinsuke <irieshinsuke@yahoo.co.jp>
Thu, 5 Jun 2014 07:08:15 +0000 (16:08 +0900)
This is followup to rB8008d9bdfd57. Blender Render and GLSL preview
now produce the same results.

source/blender/render/intern/source/shadeoutput.c

index cc781c863a09a6f859d73c6ef7e89ba6d0bcac97..ebf88efb50b55dcad0219cade24a6e7ea3d9a912 100644 (file)
@@ -1466,9 +1466,11 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
                                                shr->shad[1] -= shadfac[3]*shi->g*(1.0f-lashdw[1]);
                                                shr->shad[2] -= shadfac[3]*shi->b*(1.0f-lashdw[2]);
                                                
-                                               shr->spec[0] -= shadfac[3]*shi->specr*(1.0f-lashdw[0]);
-                                               shr->spec[1] -= shadfac[3]*shi->specg*(1.0f-lashdw[1]);
-                                               shr->spec[2] -= shadfac[3]*shi->specb*(1.0f-lashdw[2]);
+                                               if (!(lar->mode & LA_NO_SPEC)) {
+                                                       shr->spec[0] -= shadfac[3]*shi->specr*(1.0f-lashdw[0]);
+                                                       shr->spec[1] -= shadfac[3]*shi->specg*(1.0f-lashdw[1]);
+                                                       shr->spec[2] -= shadfac[3]*shi->specb*(1.0f-lashdw[2]);
+                                               }
                                                
                                                return;
                                        }