trsh Posted December 21, 2015 Share Posted December 21, 2015 I'm loading a huge animation spritessheet ~5000x4000. 1) Asset loaderPIXI.loader .add('assets/dance.json')............ 2) Adding to stage var frames = []; for (var i = 0; i < xxx; i++) { var val = pad(i, 3); frames.push(PIXI.Texture.fromFrame('xxx' + val + '.png')); } xxx = new PIXI.extras.MovieClip(frames); xxx.loop = true; xxx.visible = false; stage.addChild(xxx);3) At some point I want to make it visible to user and start playingdeerDance['movie'].visible = true;deerDance['movie'].play();When It happens there is and half-second or more a LAG (fps drop or rather everything stops in the scene) and then it plays very well with good fps. Is there any way to avoid this? Pre..load..something. So when it plays it goes smooth? Best, janis Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted December 21, 2015 Share Posted December 21, 2015 You can use https://github.com/pixijs/pixi-compressed-textures , it has special feature which will load ALL textures in video just after loader. if (renderer.type == PIXI.RENDERER_TYPE.WEBGL)renderer.plugins.compressedTextureManager.updateAllTextures(resources, true); Quote Link to comment Share on other sites More sharing options...
xerver Posted December 21, 2015 Share Posted December 21, 2015 The lag you experience comes from uploading the huge texture to the GPU. Quote Link to comment Share on other sites More sharing options...
trsh Posted December 22, 2015 Author Share Posted December 22, 2015 Thanks guys Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.