未验证 提交 99771f6c 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #20518 from zeux/ktx-optional

GLTFLoader: Fix handling of GLTF files with optional KTX2 extensions
......@@ -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;
}
}
......
......@@ -759,7 +759,16 @@ var 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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册