|
@@ -696,7 +696,16 @@ THREE.GLTFLoader = ( function () {
|
|
|
|
|
|
if ( ! loader ) {
|
|
|
|
|
|
- throw new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' );
|
|
|
+ if ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {
|
|
|
+
|
|
|
+ throw new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ // Assumes that the extension is optional and that a fallback texture is present
|
|
|
+ return null;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|