浏览代码

Add ability to load compressed textures to glTFLoader.js (#9729)

Rich Tibbett 8 年之前
父节点
当前提交
5253ced888
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      examples/js/loaders/gltf/glTFLoader.js

+ 7 - 1
examples/js/loaders/gltf/glTFLoader.js

@@ -268,7 +268,13 @@ THREE.glTFLoader.prototype.load = function( url, callback ) {
 			return texture;
 		}
 
-		return new THREE.TextureLoader().load(src);
+		var textureLoader = THREE.Loader.Handlers.get(src);
+		if ( textureLoader === null ) {
+			textureLoader = new THREE.TextureLoader();
+		}
+		textureLoader.crossOrigin = true;
+
+		return textureLoader.load(src);
 	}
 
 	function CreateTexture(resources, resource) {