|
@@ -1477,16 +1477,15 @@ var GLTFLoader = ( function () {
|
|
// BufferGeometry caching
|
|
// BufferGeometry caching
|
|
this.primitiveCache = {};
|
|
this.primitiveCache = {};
|
|
|
|
|
|
|
|
+ this.textureLoader = new TextureLoader( this.options.manager );
|
|
|
|
+ this.textureLoader.setCrossOrigin( this.options.crossOrigin );
|
|
|
|
+
|
|
// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
|
|
// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
|
|
// expensive work of uploading a texture to the GPU off the main thread.
|
|
// expensive work of uploading a texture to the GPU off the main thread.
|
|
- var imageLoader = null;
|
|
|
|
if (typeof createImageBitmap !== 'undefined') {
|
|
if (typeof createImageBitmap !== 'undefined') {
|
|
- imageLoader = new ImageBitmapLoader( this.options.manager );
|
|
|
|
|
|
+ this.textureLoader.setImageLoader( new ImageBitmapLoader( this.options.manager ) );
|
|
}
|
|
}
|
|
|
|
|
|
- this.textureLoader = new TextureLoader( this.options.manager, imageLoader );
|
|
|
|
- this.textureLoader.setCrossOrigin( this.options.crossOrigin );
|
|
|
|
-
|
|
|
|
this.fileLoader = new FileLoader( this.options.manager );
|
|
this.fileLoader = new FileLoader( this.options.manager );
|
|
this.fileLoader.setResponseType( 'arraybuffer' );
|
|
this.fileLoader.setResponseType( 'arraybuffer' );
|
|
|
|
|