Jump to content

Scene dispose and WebGl Context problems


w00dy
 Share

Recommended Posts

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...