Explorar o código

Fix bug with glTFFileLoader default texture sampler

Gary Hsu %!s(int64=8) %!d(string=hai) anos
pai
achega
dfaeccb8f2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      loaders/src/glTF/2.0/babylon.glTFLoader.ts

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

@@ -1154,7 +1154,7 @@ module BABYLON.GLTF2 {
         }
 
         private static _createTextureAsync(runtime: IGLTFRuntime, texture: IGLTFTexture, texCoord: number, url: string, onSuccess: (babylonTexture: Texture) => void, onError: () => void): void {
-            var sampler: IGLTFSampler = texture.sampler ? runtime.gltf.samplers[texture.sampler] : {};
+            var sampler: IGLTFSampler = (texture.sampler === undefined ? {} : runtime.gltf.samplers[texture.sampler]);
             var noMipMaps = (sampler.minFilter === ETextureMinFilter.NEAREST || sampler.minFilter === ETextureMinFilter.LINEAR);
             var samplingMode = GLTFUtils.GetTextureFilterMode(sampler.minFilter);