Bläddra i källkod

Sync light shaders with prod

Popov72 4 år sedan
förälder
incheckning
fb0f4f68a6

+ 1 - 1
src/Shaders/ShadersInclude/lightFragment.fx

@@ -126,7 +126,7 @@
         #endif
 
         #ifdef PROJECTEDLIGHTTEXTURE{X}
-            info.diffuse *= texture2D(projectionLightSampler{X}, computeProjectionTextureDiffuseLightingUV(textureProjectionMatrix{X})).rgb;
+            info.diffuse *= computeProjectionTextureDiffuseLighting(projectionLightSampler{X}, textureProjectionMatrix{X});
         #endif
     #endif
 

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

@@ -113,5 +113,6 @@ lightingInfo computeHemisphericLighting(vec3 viewDirectionW, vec3 vNormal, vec4
 vec3 computeProjectionTextureDiffuseLighting(sampler2D projectionLightSampler, mat4 textureProjectionMatrix){
 	vec4 strq = textureProjectionMatrix * vec4(vPositionW, 1.0);
 	strq /= strq.w;
-	return strq.xyz;
+	vec3 textureColor = texture2D(projectionLightSampler, strq.xy).rgb;
+	return textureColor;
 }