Browse Source

Fix gltf parser sampler default values

Steven Vergenz 8 năm trước cách đây
mục cha
commit
cc510a2420
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      examples/js/loaders/GLTFLoader.js

+ 4 - 4
examples/js/loaders/GLTFLoader.js

@@ -1090,10 +1090,10 @@ THREE.GLTFLoader = ( function () {
 
 								var sampler = json.samplers[ texture.sampler ];
 
-								_texture.magFilter = WEBGL_FILTERS[ sampler.magFilter ];
-								_texture.minFilter = WEBGL_FILTERS[ sampler.minFilter ];
-								_texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ];
-								_texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ];
+								_texture.magFilter = WEBGL_FILTERS[ sampler.magFilter || 9729 ];
+								_texture.minFilter = WEBGL_FILTERS[ sampler.minFilter || 9986 ];
+								_texture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS || 10497 ];
+								_texture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT || 10497 ];
 
 							}