1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

fix SSAOPass (cs and unneeded resize)

This commit is contained in:
Kevin Levron 2021-04-01 22:31:57 +02:00
parent 36a7e7f519
commit 9cf540b0b7

View File

@ -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',
};