Procházet zdrojové kódy

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

Rich Tibbett před 9 roky
rodič
revize
5253ced888
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  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) {