ソースを参照

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

Rich Tibbett 9 年 前
コミット
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) {