瀏覽代碼

* Fix issue where lighting shader would not compile when vertex lighting is used (due to recent HW skinning changes)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10561 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
ShA..Rd 12 年之前
父節點
當前提交
1f27804716
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      engine/src/core-data/Common/MatDefs/Light/Lighting.vert

+ 8 - 1
engine/src/core-data/Common/MatDefs/Light/Lighting.vert

@@ -135,10 +135,17 @@ vec2 computeLighting(in vec3 wvPos, in vec3 wvNorm, in vec3 wvViewDir, in vec4 w
 void main(){
    vec4 modelSpacePos = vec4(inPosition, 1.0);
    vec3 modelSpaceNorm = inNormal;
-   vec3 modelSpaceTan  = inTangent.xyz;
+   
+   #ifndef VERTEX_LIGHTING
+        vec3 modelSpaceTan  = inTangent.xyz;
+   #endif
 
    #ifdef NUM_BONES
+        #ifndef VERTEX_LIGHTING
         Skinning_Compute(modelSpacePos, modelSpaceNorm, modelSpaceTan);
+        #else
+        Skinning_Compute(modelSpacePos, modelSpaceNorm);
+        #endif
    #endif
 
    gl_Position = g_WorldViewProjectionMatrix * modelSpacePos;