Browse Source

Fix bug when no light was in the scene

Temechon 9 năm trước cách đây
mục cha
commit
41291df596
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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