Browse Source

Lighting material now normalize normal value read from the normal map to avoid banding artifacts

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9261 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om 13 years ago
parent
commit
203bc00a7d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      engine/src/core-data/Common/MatDefs/Light/Lighting.frag

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

@@ -211,7 +211,7 @@ void main(){
     // ***********************
     // ***********************
     #if defined(NORMALMAP) && !defined(VERTEX_LIGHTING)
     #if defined(NORMALMAP) && !defined(VERTEX_LIGHTING)
       vec4 normalHeight = texture2D(m_NormalMap, newTexCoord);
       vec4 normalHeight = texture2D(m_NormalMap, newTexCoord);
-      vec3 normal = (normalHeight.xyz * vec3(2.0) - vec3(1.0));
+      vec3 normal = normalize((normalHeight.xyz * vec3(2.0) - vec3(1.0)));
       #ifdef LATC
       #ifdef LATC
         normal.z = sqrt(1.0 - (normal.x * normal.x) - (normal.y * normal.y));
         normal.z = sqrt(1.0 - (normal.x * normal.x) - (normal.y * normal.y));
       #endif
       #endif