diff --git a/examples/jsm/Addons.js b/examples/jsm/Addons.js index 81a0a1d6a8a01a..8bbc6f1bd5a941 100644 --- a/examples/jsm/Addons.js +++ b/examples/jsm/Addons.js @@ -274,7 +274,7 @@ export * as SceneUtils from './utils/SceneUtils.js'; export * from './utils/ShadowMapViewer.js'; export * as SkeletonUtils from './utils/SkeletonUtils.js'; export * as SortUtils from './utils/SortUtils.js'; -export * from './utils/TextureUtils.js'; +export * from './utils/WebGLTextureUtils.js'; export * from './utils/UVsDebug.js'; export * from './utils/WorkerPool.js'; diff --git a/examples/jsm/exporters/GLTFExporter.js b/examples/jsm/exporters/GLTFExporter.js index 52cc3c1c82ccf0..959ea61d24c105 100644 --- a/examples/jsm/exporters/GLTFExporter.js +++ b/examples/jsm/exporters/GLTFExporter.js @@ -26,7 +26,7 @@ import { Quaternion, REVISION } from 'three'; -import { decompress } from './../utils/TextureUtils.js'; +import { decompress } from './../utils/WebGLTextureUtils.js'; /** diff --git a/examples/jsm/exporters/USDZExporter.js b/examples/jsm/exporters/USDZExporter.js index cb116c189c3919..65de4f5b82da4e 100644 --- a/examples/jsm/exporters/USDZExporter.js +++ b/examples/jsm/exporters/USDZExporter.js @@ -9,10 +9,20 @@ import { zipSync, } from '../libs/fflate.module.js'; -import { decompress } from './../utils/TextureUtils.js'; - class USDZExporter { + constructor() { + + this.textureUtils = null; + + } + + setTextureUtils( utils ) { + + this.textureUtils = utils; + + } + parse( scene, onDone, onError, options ) { this.parseAsync( scene, options ).then( onDone ).catch( onError ); @@ -98,7 +108,15 @@ class USDZExporter { if ( texture.isCompressedTexture === true ) { - texture = decompress( texture ); + if ( this.textureUtils === null ) { + + throw new Error( 'THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.' ); + + } else { + + texture = await this.textureUtils.decompress( texture ); + + } } diff --git a/examples/jsm/utils/TextureUtils.js b/examples/jsm/utils/WebGLTextureUtils.js similarity index 100% rename from examples/jsm/utils/TextureUtils.js rename to examples/jsm/utils/WebGLTextureUtils.js diff --git a/examples/jsm/utils/TextureUtilsGPU.js b/examples/jsm/utils/WebGPUTextureUtils.js similarity index 100% rename from examples/jsm/utils/TextureUtilsGPU.js rename to examples/jsm/utils/WebGPUTextureUtils.js