From 9cf540b0b76b72f766ca1ba1470e7719f0e568c2 Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Thu, 1 Apr 2021 22:31:57 +0200 Subject: [PATCH] fix SSAOPass (cs and unneeded resize) --- src/effects/SSAOPass.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/effects/SSAOPass.js b/src/effects/SSAOPass.js index 0c501f0..ba625a0 100644 --- a/src/effects/SSAOPass.js +++ b/src/effects/SSAOPass.js @@ -8,8 +8,8 @@ export default { camera: null, options: { type: Object, - default: () => ({}) - } + default: () => ({}), + }, }, mounted() { const pass = new SSAOPass( @@ -18,22 +18,12 @@ export default { this.three.size.width, this.three.size.height ); - this.completePass(pass); - for (let key of Object.keys(this.options)) { - this.pass[key] = this.options[key]; + for (const key of Object.keys(this.options)) { + pass[key] = this.options[key]; } - // resize will be called in three init - this.three.onAfterResize(this.resize); - }, - unmounted() { - this.three.offAfterResize(this.resize); - }, - methods: { - resize() { - this.pass.width = this.three.size.width - this.pass.height = this.three.size.height - }, + + this.completePass(pass); }, __hmrId: 'SSAOPass', };