Closed Steve245270533 closed 3 weeks ago
renderer.info.programs should be cleared
Programs and other disposable resources will be recreated automatically if you call render
after calling dispose
.
Your reproduction steps are incomplete. How exactly are you disposing things? Have you debugged your code and checked whether dispose
is being called on the respective resources? Please provide a complete and minimal reproduction of the issue instead of code snippets.
renderer.info.programs should be cleared
Programs and other disposable resources will be recreated automatically if you call
render
after callingdispose
.Your reproduction steps are incomplete. How exactly are you disposing things? Have you debugged your code and checked whether
dispose
is being called on the respective resources? Please provide a complete and minimal reproduction of the issue instead of code snippets.
This is the smallest scene I restored. It seems that any Effect added cannot be cleaned up normally. stackblitz-demo
Thanks for the example :+1:
This does indeed look like a bug. The dispose
method in Pass
doesn't dispose the fullscreen material because that property is defined as a getter/setter which doesn't get picked up by Object.keys
. I'll work on a fix.
In the meantime, you can manually dispose those materials as shown here: vitejs-vite-als1ht
Note that the remaining geometry is the fullscreen triangle that is shared by all postprocessing passes. The lifetime of that mesh is basically tied to the WebGL context and it's being reused when needed so it shouldn't do any harm. That being said, I'll check if it can be disposed somehow.
Thank you very much. Currently, manually disposing of these passes materials is effective.
Description of the bug
When destroying the entire three context, two methods
removeToneMappingPass
,removeSceneFadePass
are called in the destroy method of the PostProcessingEffect class, both methods call theEffect
andEffectPass
'sdispose
method, but by printingrenderer.info
to see that there are still uncleaned programsTo reproduce
Expected behavior
renderer.info.programs
should be clearedScreenshots
Library versions used
Desktop
Mobile