Jelajahi Sumber

Fix bug when metallicFactor or roughnessFactor is zero

Gary Hsu 8 tahun lalu
induk
melakukan
bf2e046e11
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      loaders/src/glTF/2.0/babylon.glTFLoader.ts

+ 2 - 2
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -955,8 +955,8 @@ module BABYLON.GLTF2 {
             //
 
             material.babylonMaterial.albedoColor = properties.baseColorFactor ? Color3.FromArray(properties.baseColorFactor) : new Color3(1, 1, 1);
-            material.babylonMaterial.metallic = properties.metallicFactor || 1;
-            material.babylonMaterial.roughness = properties.roughnessFactor || 1;
+            material.babylonMaterial.metallic = properties.metallicFactor === undefined ? 1 : properties.metallicFactor;
+            material.babylonMaterial.roughness = properties.roughnessFactor === undefined ? 1 : properties.roughnessFactor;
 
             //
             // Load Textures