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:(
155
155
[effectBody appendFormat: @" lightDist = length(v_tangentSpaceLightDir%lu .xyz);\n " , (unsigned long )lightIndex];
156
156
[effectBody appendFormat: @" falloffTerm = max(0.0, (1.0 - lightDist * u_lightFalloff%lu ));\n " , (unsigned long )lightIndex];
157
157
[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
+ }
159
162
}
160
163
[effectBody appendString: @" diffuseTerm = max(0.0, dot(tangentSpaceNormal, tangentSpaceLightDir));\n " ];
161
164
[effectBody appendString: @" diffuseSum += lightColor * diffuseTerm;\n " ];
You can’t perform that action at this time.
0 commit comments