PIXI.Graphics.renderWebGL / renderGraphic - performance problems - SOS!

Recommended Posts

I'm pretty much at my wit's end hear. Thus I am resorting to an SOS forum post. 

I've encountered a very strange performance bug. It's more or less untraceable because it is caused by a bunch of internal calls made by phaser and pixi. This is the culprit (according to the chrome performance profiler):


This happens every 20 seconds or so. A massive FPS drop with several animation frames hanging on PIXI.WebGLRenderer.render.

I've gone to great lengths to identify the root cause, including putting a return statement at all of my core functions, monitoring performance, and seeing if the problem is still there. But I can't seem to find the cause as the problem goes away and comes back unpredictably. 

What I'm hoping for is some sort of explanation as to what Pixi is doing here. Is this related to Phaser.Graphics? What would be a common cause of phaser needing to call updateRender so many times in just a few animation frames?

I realize this is a long shot. Any insight would be helpful. 


Share this post

Link to post
Share on other sites

if i put a return statement below PIXI.Graphics.prototype._renderWebGL = function(renderSession) - the problem goes away so i know it's that.
i put a statement in there to trace which graphics is causing the problem, i.e.
if(game.time.fps < 40) {
    } in PIXI.Graphics.prototype._renderWebGL

here's what's so bizarre. i identify the graphic which causes the problem based on its world position, etc. then i remove the graphic entirely and try again what happens is that another separate graphic will cause the FPS drop. which leads me to believe that any presence of a Phaser.Graphics - regardless of what I do with it, causes the problem. How can this be?

Share this post

Link to post
Share on other sites

well, i can confirm that it is in fact phaser graphics that are causing the problem. The problem is that it's not any one graphic. If I set ALL graphics (there are 10 total) to visible = false, the problem goes away. But setting any 1 graphic not visible, with the rest visible, does not cause the problem to stop. 

I can honestly say that I've never seen a bug like this before. 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.