Jump to content

Too many active WebGL contexts...


Marian
 Share

Recommended Posts

Hello,
I'm creating a web-component with pixijs, just now I ' want  use this multiply on my webpage but I can only 16 times this create and I take a warning :
"ContextSystem.js:118 WARNING: Too many active WebGL contexts. Oldest context will be lost."

How many WebGl context or PIXI.Application can I create on one time ? 

 

Thanks 

Marian

Link to comment
Share on other sites

I experienced this error as well in the past, was not with Pixi though but with my own very basic framework. In my case the browser refused to call WebGL methods after refreshing the page too many times on a short time. Probably because I put the entire thing too much on pressure. What worked for me was refreshing the cache with Ctrl+F5 or restarting my browser.

Link to comment
Share on other sites

Hi,

thanks ..

I'm make simply test and create 20 times

var app = new PIXI.Application({ antialias: true });
document.body.appendChild(app.view);
var graphics = new PIXI.Graphics();
// Rectangle
graphics.beginFill(0xDE3249);
graphics.drawRect(50, 50, 100, 100);
graphics.endFill();
app.stage.addChild(graphics);
...


and I'm take the same warning: "Too many active WebGL contexts. Oldest context will be lost."

same behavir with only create renderer  (20 times):

rend = new PIXI.Renderer({ width: 100, height: 60, backgroundColor: 0x1099bb });
document.body.appendChild(rend.view);

.
.
.
.

 

seems like limit from WebGL ?

someone a idea ?

can I have multiple canvas (20)  with only one renderer ?

Thanks !

 

 

 

 

 

 

Link to comment
Share on other sites

As Exca mentioned this is an actual browser limitation. There is a limit to the number of WebGL contexts you are allowed to create in a single page. The actual number depends on your environment and browser.

Quote

can I have multiple canvas (20)  with only one renderer ?

No, one canvas has 1 renderer.

Link to comment
Share on other sites

  • 11 months later...

I experienced the same issue but why in this website https://orkestra.ca/en/team-and-careers
they manage to use PIXI.Application() for multiple canvas more than 20 canvas.

 

As I can see they used destroy() method after 16 item and then create again I have no idea is my conclusion is right.

is anyone can provide a solution for this issue or limitation?

 

Thanks,

Link to comment
Share on other sites

  • 3 weeks later...

They are using 2d canvas, not 3d. 2d canvas has no limitations on amount as its run on the cpu and basically memory is the limiting factor in that.

As a warning if you are going to do lots of canvases then you need to make sure they are updated only when needed. Otherwise your site will be very cpu heavy.

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...