Sign in to follow this  
Slaus

All the graphics sometimes disappear when loading finishes

Recommended Posts

Hello everyone. In my 100k+ lines_of_code project in late weeks was introduced a bug which sometimes causes all the graphics to disappear at the end of loading process.

Could you please help me to hunt it down?

First, game loads background and loading bar with PIXI.loader and displays it with PIXI. Then loads all the other resources the same way. When other resources finish loading there is a chance (50% for some machines and <1% for others) that none will be displayed and both background and loading bar also disappear.

When it happens, line:

PIXI.renderer.render( stage )

throws these errors (currently using PIXI 4.5.3):pixi.thumb.png.73229538266bc7f75d1063d0f895bdee.png

where Sprite.js:208 of my version is sprite_208.png.31ca960f13cfa9fea78613c3e7c88ec7.png

and WebGLRenderer.js:408 is webglrenderer_480.png.bfb795801b4833e0a61b830edcc0b405.png

I was trying to examine and reverse every change made to the project for last weeks, but they are pretty innocent and it didn't help :(

What I figured out so far is that sprite.baseTexture.orig of every existing image somehow becomes null at some point and every width() getter stops working which throws such exceptions, but weird part is that these errors are only thrown once - not every requestAnimationFrame() call, hmm. And I couldn't find any line in PIXI and PIXI.loader where there would be something like sprite.baseTexture.orig = null or BaseTexture: this.orig = null ...

Do you guys have any ideas what could cause such behavior and any possible steps to fix it? Thanks in advance! ;)

Share this post


Link to post
Share on other sites

Found the reason: I had a custom shader for which I was getting dummy (to make shader working) texture this way:

    let whatever
    for ( let i in PIXI.utils.TextureCache ) {
        if ( i.indexOf( '.json' ) >= 0 ) continue
        whatever = i
        break
    }

sometimes it happen so that loadbar/loadscreen.png was obtained this way and after a while loading scene was destroyed:

load_scene.destroy( true )

which cause loadbar/loadscreen.png textures to also remove which lead to shader stop working and PIXI to shutdown.

Thanks for help! Glad everything's working again! Cheers!

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.