Browse Source

Fixed missing masked pointlight rotation on OpenGL light pre-pass mode.

Lasse Öörni 14 years ago
parent
commit
d7884cbfa5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      SourceAssets/GLSLShaders/LightVolume.frag

+ 2 - 1
SourceAssets/GLSLShaders/LightVolume.frag

@@ -85,7 +85,8 @@ void main()
         vec4 spotPos = cLightMatricesPS[0] * projWorldPos;
         lightColor = spotPos.w > 0.0 ? texture2DProj(sLightSpotMap, spotPos).rgb * cLightColor.rgb : vec3(0.0, 0.0, 0.0);
     #elif defined(CUBEMASK)
-        lightColor = textureCube(sLightCubeMap, lightVec).rgb * cLightColor.rgb;
+        mat3 lightVecRot = mat3(cLightMatricesPS[0][0].xyz, cLightMatricesPS[0][1].xyz, cLightMatricesPS[0][2].xyz);
+        lightColor = textureCube(sLightCubeMap, lightVecRot * lightVec).rgb * cLightColor.rgb;
     #else
         lightColor = cLightColor.rgb;
     #endif