[Vuejs]-After reloading page animation fps is changing every time

0đź‘Ť

This error shows up in the console:

Too many active WebGL contexts

I am guessing it’s not a good practice to create a new renderer and redo all the work for each mount?

I tried to keep the component alive and the problem is gone.

<keep-alive>
    <router-view/>
</keep-alive>

Or you could try to move the renderer up to the parent component and reuse it, rather than creating a new one for each mount.

Btw, try the extension PixiJS Inspector, it’s good for PIXI debugging. It also shows that every time you click on “About”, a new PIXI container is created. With the solution above, there will only be one throughout user interactions.

reference: https://github.com/pixijs/pixi.js/issues/2233

👤whales

Leave a comment