mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 18:52:18 +00:00
Dispose the Navara bloom and sharpen passes when their effect is deleted
EffectComposer.removePass does not dispose a pass. One withPassDisposal mixin now does it for the bloom, sharpen, styles and overlay effects.
This commit is contained in:
1 parent
b49f9dddf0
commit
cbe1d841ea
6 files changed
+67
-27
No files matched your search
@@ -6,13 +6,14 @@
|
||||
|
||||
import { EffectDesc, Pass as NavaraPass } from '@navaramap/three';
|
||||
import { pipelinePassNames } from './internals.js';
|
||||
import { withPassDisposal } from './frameDescriptor.js';
|
||||
import {
|
||||
GevStylesPass,
|
||||
STYLES_EFFECT_KEY,
|
||||
createStylesPort,
|
||||
} from './stylePass.js';
|
||||
|
||||
class StylesEffectDesc extends EffectDesc {
|
||||
class StylesEffectDesc extends withPassDisposal(EffectDesc) {
|
||||
static key = STYLES_EFFECT_KEY;
|
||||
// Last before Navara's final copy: after bloom when it is on, else after
|
||||
// everything the scene and its overlays draw (nothing anchors after it).
|
||||
@@ -31,15 +32,6 @@ class StylesEffectDesc extends EffectDesc {
|
||||
// postprocessing copy: wrap it (as overlay.js does).
|
||||
return new NavaraPass(new GevStylesPass(this.controller), null);
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
const pass = this.raw?.rawPass;
|
||||
try {
|
||||
super.onDestroy();
|
||||
} finally {
|
||||
pass?.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user