Game stutters when displaying a new object

Every time I display a new object in the game, e.g. a new enemy/obstacle type, the game gets visibly stuck. I think the reason is due to the use of new material and shader build. I got around this by showing all objects somewhere out of camera visibility for the first frame of the game, and then hiding everything again on the next update (pc.Entity.enabled = false). But isn’t there a better solution? Thanks

Hi @NokFrt,

That’s correct, that’s the proposed work around right now.

There is work being done for parallel shader compilation: Smooth loading of non-preloaded assets · Issue #5242 · playcanvas/engine · GitHub

Check this related forum post too: [SOLVED] Application will stutter in the Intro Animation - #31 by mvaligursky

1 Like