Browse Source

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

Rich Tibbett 8 years ago
parent
commit
5253ced888
1 changed files with 7 additions and 1 deletions
  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) {