File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ +(NSMutableArray *)buildFragmentFunctionsWithLights:(NSArray*)lights normalMap:(
155155 [effectBody appendFormat: @" lightDist = length(v_tangentSpaceLightDir%lu .xyz);\n " , (unsigned long )lightIndex];
156156 [effectBody appendFormat: @" falloffTerm = max(0.0, (1.0 - lightDist * u_lightFalloff%lu ));\n " , (unsigned long )lightIndex];
157157 [effectBody appendFormat: @" lightColor = u_lightColor%lu * falloffTerm;\n " , (unsigned long )lightIndex];
158- [effectBody appendFormat: @" lightSpecularColor = u_lightSpecularColor%lu * falloffTerm;\n " , (unsigned long )lightIndex];
158+ if (needsSpecular)
159+ {
160+ [effectBody appendFormat: @" lightSpecularColor = u_lightSpecularColor%lu * falloffTerm;\n " , (unsigned long )lightIndex];
161+ }
159162 }
160163 [effectBody appendString: @" diffuseTerm = max(0.0, dot(tangentSpaceNormal, tangentSpaceLightDir));\n " ];
161164 [effectBody appendString: @" diffuseSum += lightColor * diffuseTerm;\n " ];
You can’t perform that action at this time.
0 commit comments