When I have multiple engines/scenes on a page in iframes or multiple browser tabs open, video memory overflows and context is lost.
How to manage resources correctly? Delete an engine when a tab is out of focus?
Maybe Babylon has built-in functions for this?
The Viewer V2 has the built-in suspended rendering feature. Here is the thread with more info and examples on this subject - Viewer v2 render considerations - #3 by ryantrem
If the Babylon Viewer meets your needs, happy to go further on this topic. If the Viewer is not a good fit for your scenario, then I don’t think we have general built-in behavior for engine teardown/setup based on tab visibility etc. other than the default logic for recovering from context lost.
1 Like
My solution for now is that if there is no interaction with a scene for a while, I delete it and set a splash screen for loading the scene again.