Browse Source

Fix bug when no light was in the scene

Temechon 9 years ago
parent
commit
41291df596
1 changed files with 4 additions and 1 deletions
  1. 4 1
      materialsLibrary/materials/normal/normal.fragment.fx

+ 4 - 1
materialsLibrary/materials/normal/normal.fragment.fx

@@ -60,7 +60,10 @@ void main(void) {
 	baseColor.rgb *= vDiffuseInfos.y;
 #endif
 
-baseColor = mix(baseColor, vec4(vNormalW, 1.0), 0.5);
+#ifdef NORMAL
+    baseColor = mix(baseColor, vec4(vNormalW, 1.0), 0.5);
+#endif
+
 #ifdef VERTEXCOLOR
 	baseColor.rgb *= vColor.rgb;
 #endif