瀏覽代碼

fixed the fix

David Catuhe 8 年之前
父節點
當前提交
b6fea365c2
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Shaders/ShadersInclude/lightsFragmentFunctions.fx

+ 2 - 2
src/Shaders/ShadersInclude/lightsFragmentFunctions.fx

@@ -55,12 +55,12 @@ lightingInfo computeSpotLighting(vec3 viewDirectionW, vec3 vNormal, vec4 lightDa
 		attenuation *= cosAngle;
 
 		// Diffuse
-		float ndl = max(0., dot(vNormal, direction.xyz));
+		float ndl = max(0., dot(vNormal, lightVectorW));
 		result.diffuse = ndl * diffuseColor * attenuation;
 
 #ifdef SPECULARTERM
 		// Specular
-		vec3 angleW = normalize(direction.xyz - viewDirectionW);
+		vec3 angleW = normalize(lightVectorW - viewDirectionW);
 		float specComp = max(0., dot(vNormal, angleW));
 		specComp = pow(specComp, max(1., glossiness));