w00dy Posted January 3, 2018 Share Posted January 3, 2018 Hi everyone, we ware currently facing the following issue with babylon.js 3.1.1: Our application provides to functionality to look at a loadspace of a truck. It is possible to look at different "views" (e.g. 4 -> available browser space is split up into 4 rectangles). For every view a new engine and scene is created. The user has the possibility to switch between 1, 2 or 4 views at the same time. So if the user wants to see 4 views, we create 3 additionals one. If the user wants to see only 1 we remove the other 3... We remove the not longer neccesary views (scenes) like the following: engine.stopRenderLoop(); this.scene.dispose(); this.scene = null; After some time, we get the following messages on different browsers (tested with Chrome 63, Firefox 57) Chrome WebGL2: WARNING: Too many active WebGL contexts. Oldest context will be lost. Firefox 57 WebGL: Error: WebGL warning: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. Internet Explorer/Edge didn't raised a message like this. Any ideas out there how to prevent the WebGL contextes from exceeding or how to erase the scene properly? Thank you very much! holger Quote Link to comment Share on other sites More sharing options...
MarianG Posted January 3, 2018 Share Posted January 3, 2018 Hey. You should use viewports instead of different engine and scenes. Or if you want to use diferrent scenes you can use the same engine foreach scene. Usefull links: https://doc.babylonjs.com/how_to/how_to_use_multi-views https://www.babylonjs-playground.com/#13TVWJ#2 RaananW and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 3, 2018 Share Posted January 3, 2018 What he said ^^^^^^ GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
w00dy Posted January 4, 2018 Author Share Posted January 4, 2018 Hi, the point is that every scene can represent another level of the context. Everything is based on the same data model. E.g. on first view with the scene you can see the whole loadspace, the second view with another scene only show a pallet which is inside the loadspace, etc... So If we have 4 views (4 scenes) and every scene represents another level of our context (loadspace, pallett, box on pallett, loadspace again with other camera) and you can interact with each of them seperatly e.g. camera movement, zoom in and out, etc. without changing the other three views. The only thing is that we synchronise them if there are changes of the data model. E.g. rotation of a pallet in one of the views will be sync to the other three views. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.