SPLighting.frag: fix syntax error with vertex lighting enabled

experimental
Kirill Vainer 10 years ago
parent 0c846eaf6a
commit 1fec72605f
  1. 20
      jme3-core/src/main/resources/Common/MatDefs/Light/SPLighting.frag

@ -72,17 +72,19 @@ uniform float m_Shininess;
#endif #endif
void main(){ void main(){
#ifdef NORMALMAP #if !defined(VERTEX_LIGHTING)
mat3 tbnMat = mat3(normalize(vTangent.xyz) , normalize(vBinormal.xyz) , normalize(vNormal.xyz)); #if defined(NORMALMAP)
mat3 tbnMat = mat3(normalize(vTangent.xyz) , normalize(vBinormal.xyz) , normalize(vNormal.xyz));
if (!gl_FrontFacing) if (!gl_FrontFacing)
{ {
tbnMat[2] = -tbnMat[2]; tbnMat[2] = -tbnMat[2];
} }
vec3 viewDir = normalize(-vPos.xyz * tbnMat); vec3 viewDir = normalize(-vPos.xyz * tbnMat);
#else #else
vec3 viewDir = normalize(-vPos.xyz); vec3 viewDir = normalize(-vPos.xyz);
#endif
#endif #endif
vec2 newTexCoord; vec2 newTexCoord;

Loading…
Cancel
Save