瀏覽代碼

Fix bug when no light was in the scene

Temechon 9 年之前
父節點
當前提交
41291df596
共有 1 個文件被更改,包括 4 次插入1 次删除
  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