Explorar o código

fixed the fix

David Catuhe %!s(int64=8) %!d(string=hai) anos
pai
achega
b6fea365c2
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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));