瀏覽代碼

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

Lasse Öörni 14 年之前
父節點
當前提交
d7884cbfa5
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      SourceAssets/GLSLShaders/LightVolume.frag

+ 2 - 1
SourceAssets/GLSLShaders/LightVolume.frag

@@ -85,7 +85,8 @@ void main()
         vec4 spotPos = cLightMatricesPS[0] * projWorldPos;
         vec4 spotPos = cLightMatricesPS[0] * projWorldPos;
         lightColor = spotPos.w > 0.0 ? texture2DProj(sLightSpotMap, spotPos).rgb * cLightColor.rgb : vec3(0.0, 0.0, 0.0);
         lightColor = spotPos.w > 0.0 ? texture2DProj(sLightSpotMap, spotPos).rgb * cLightColor.rgb : vec3(0.0, 0.0, 0.0);
     #elif defined(CUBEMASK)
     #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
     #else
         lightColor = cLightColor.rgb;
         lightColor = cLightColor.rgb;
     #endif
     #endif