diff --git a/packages/front/package.json b/packages/front/package.json index e3f131440..2affe6d52 100644 --- a/packages/front/package.json +++ b/packages/front/package.json @@ -1,7 +1,7 @@ { "name": "@thatopen/components-front", "description": "Collection of frontend tools to author BIM apps.", - "version": "2.0.13", + "version": "2.0.14", "author": "That Open Company", "contributors": [ "Antonio Gonzalez Viegas (https://github.com/agviegas)", diff --git a/packages/front/src/core/PostproductionRenderer/src/custom-effects-pass.ts b/packages/front/src/core/PostproductionRenderer/src/custom-effects-pass.ts index 9d6e6fd1c..6e39cc7e3 100644 --- a/packages/front/src/core/PostproductionRenderer/src/custom-effects-pass.ts +++ b/packages/front/src/core/PostproductionRenderer/src/custom-effects-pass.ts @@ -169,6 +169,7 @@ export class CustomEffectsPass extends Pass { this.outlineBuffer.dispose(); this.normalOverrideMaterial.dispose(); this.glossOverrideMaterial.dispose(); + this.fsQuad.material.dispose(); this.fsQuad.dispose(); this.excludedMeshes = []; @@ -198,6 +199,7 @@ export class CustomEffectsPass extends Pass { 1 / this.resolution.x, 1 / this.resolution.y, ); + material.uniformsNeedUpdate = true; } render(renderer: THREE.WebGLRenderer, writeBuffer: any, readBuffer: any) { diff --git a/packages/front/src/core/PostproductionRenderer/src/postproduction.ts b/packages/front/src/core/PostproductionRenderer/src/postproduction.ts index df151cd5a..b927cad8c 100644 --- a/packages/front/src/core/PostproductionRenderer/src/postproduction.ts +++ b/packages/front/src/core/PostproductionRenderer/src/postproduction.ts @@ -207,11 +207,21 @@ export class Postproduction { */ setSize(width: number, height: number) { if (this._initialized) { + const customEnabled = this._settings.custom; + if (customEnabled) { + // For some reason, the custom pass quality degrades if it's resized while being active + // Maybe we should investigate this at some point + this.setPasses({ custom: false }); + } + this.setPasses({ custom: false }); this.composer.setSize(width, height); this.basePass.setSize(width, height); this.n8ao.setSize(width, height); this.customEffects.setSize(width, height); this.gammaPass.setSize(width, height); + if (customEnabled) { + this.setPasses({ custom: true }); + } } }