From 1a0b65244f5bdaf819bea364f6fade670db4b33d Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 16 Oct 2023 15:57:58 +0000 Subject: [PATCH 1/5] Fix for dispose error sampleRenderTarget is being deleted and set to null by super.dispose(); the check for undefined was incorrect causing an attempt to call dispose on a null object. --- examples/jsm/postprocessing/TAARenderPass.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/jsm/postprocessing/TAARenderPass.js b/examples/jsm/postprocessing/TAARenderPass.js index 74f764a7461ef2..a4888afcc8b5ef 100644 --- a/examples/jsm/postprocessing/TAARenderPass.js +++ b/examples/jsm/postprocessing/TAARenderPass.js @@ -147,8 +147,8 @@ class TAARenderPass extends SSAARenderPass { super.dispose(); - if ( this.sampleRenderTarget !== undefined ) this.sampleRenderTarget.dispose(); - if ( this.holdRenderTarget !== undefined ) this.holdRenderTarget.dispose(); + if ( this.sampleRenderTarget ) this.sampleRenderTarget.dispose(); + if ( this.holdRenderTarget ) this.holdRenderTarget.dispose(); } From 6e4b77e2e1593cae89176418cd464245dfbe852e Mon Sep 17 00:00:00 2001 From: Jesse Date: Mon, 16 Oct 2023 17:26:21 +0000 Subject: [PATCH 2/5] Removed disposal of sampleRenderTarget entierly --- examples/jsm/postprocessing/TAARenderPass.js | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/jsm/postprocessing/TAARenderPass.js b/examples/jsm/postprocessing/TAARenderPass.js index a4888afcc8b5ef..fb8c5a303b8320 100644 --- a/examples/jsm/postprocessing/TAARenderPass.js +++ b/examples/jsm/postprocessing/TAARenderPass.js @@ -147,7 +147,6 @@ class TAARenderPass extends SSAARenderPass { super.dispose(); - if ( this.sampleRenderTarget ) this.sampleRenderTarget.dispose(); if ( this.holdRenderTarget ) this.holdRenderTarget.dispose(); } From 0057dfc46d1f3bc9a1295b06455083a2b9dc89ae Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 2 Nov 2023 22:05:22 +0000 Subject: [PATCH 3/5] Fix for setting path not affecting GLTF Sub Assets correctly. --- examples/jsm/loaders/GLTFLoader.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/jsm/loaders/GLTFLoader.js b/examples/jsm/loaders/GLTFLoader.js index 8436a3d2d6f61a..dfb1b3c30108a2 100644 --- a/examples/jsm/loaders/GLTFLoader.js +++ b/examples/jsm/loaders/GLTFLoader.js @@ -182,8 +182,13 @@ class GLTFLoader extends Loader { resourcePath = this.resourcePath; } else if ( this.path !== '' ) { - - resourcePath = this.path; + // If a base path is set, resources will be relative paths from that + // Example path = 'https://my-cnd-server.com/', url = 'assets/models/model.gltf' + // resourcePath = 'https://my-cnd-server.com/assets/models/' + // referenced resource 'model.bin' will be loaded from 'https://my-cnd-server.com/assets/models/model.bin' + // referenced resource '../textures/texture.png' will be loaded from 'https://my-cnd-server.com/assets/textures/texture.png' + const relativeUrl = LoaderUtils.extractUrlBase(url); + resourcePath = LoaderUtils.resolveURL(relativeUrl, this.path); } else { From 92252a0b0b7ec107ee22fd64a842ca80d5bf9beb Mon Sep 17 00:00:00 2001 From: Jesse Date: Thu, 2 Nov 2023 22:14:17 +0000 Subject: [PATCH 4/5] Fixed Comment --- examples/jsm/loaders/GLTFLoader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/jsm/loaders/GLTFLoader.js b/examples/jsm/loaders/GLTFLoader.js index dfb1b3c30108a2..4944540d1382ec 100644 --- a/examples/jsm/loaders/GLTFLoader.js +++ b/examples/jsm/loaders/GLTFLoader.js @@ -182,7 +182,7 @@ class GLTFLoader extends Loader { resourcePath = this.resourcePath; } else if ( this.path !== '' ) { - // If a base path is set, resources will be relative paths from that + // If a base path is set, resources will be relative paths from that plus the relative path of the gltf file // Example path = 'https://my-cnd-server.com/', url = 'assets/models/model.gltf' // resourcePath = 'https://my-cnd-server.com/assets/models/' // referenced resource 'model.bin' will be loaded from 'https://my-cnd-server.com/assets/models/model.bin' From 39f00594c0420d1208ce1f07857a98f9310bf9a5 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Fri, 3 Nov 2023 19:23:22 +0100 Subject: [PATCH 5/5] Update GLTFLoader.js Fix code style. --- examples/jsm/loaders/GLTFLoader.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/jsm/loaders/GLTFLoader.js b/examples/jsm/loaders/GLTFLoader.js index 4944540d1382ec..3660eeca50cfcd 100644 --- a/examples/jsm/loaders/GLTFLoader.js +++ b/examples/jsm/loaders/GLTFLoader.js @@ -182,13 +182,14 @@ class GLTFLoader extends Loader { resourcePath = this.resourcePath; } else if ( this.path !== '' ) { + // If a base path is set, resources will be relative paths from that plus the relative path of the gltf file // Example path = 'https://my-cnd-server.com/', url = 'assets/models/model.gltf' // resourcePath = 'https://my-cnd-server.com/assets/models/' // referenced resource 'model.bin' will be loaded from 'https://my-cnd-server.com/assets/models/model.bin' // referenced resource '../textures/texture.png' will be loaded from 'https://my-cnd-server.com/assets/textures/texture.png' - const relativeUrl = LoaderUtils.extractUrlBase(url); - resourcePath = LoaderUtils.resolveURL(relativeUrl, this.path); + const relativeUrl = LoaderUtils.extractUrlBase( url ); + resourcePath = LoaderUtils.resolveURL( relativeUrl, this.path ); } else {