Explorar o código

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

Rich Tibbett %!s(int64=9) %!d(string=hai) anos
pai
achega
5253ced888
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  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) {