From 1f27804716100c9ca89b00f2c831c4469a89e8fa Mon Sep 17 00:00:00 2001 From: "ShA..Rd" Date: Fri, 19 Apr 2013 16:57:57 +0000 Subject: [PATCH] * 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 --- engine/src/core-data/Common/MatDefs/Light/Lighting.vert | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engine/src/core-data/Common/MatDefs/Light/Lighting.vert b/engine/src/core-data/Common/MatDefs/Light/Lighting.vert index f9a303631..72323cbae 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Lighting.vert +++ b/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;