ecv Posted June 3, 2016 Share Posted June 3, 2016 Is there a substantial difference in performance using big frame animations vs smaller ones? What about movement? Thanks. Quote Link to comment Share on other sites More sharing options...
mattstyles Posted June 6, 2016 Share Posted June 6, 2016 @ivan.popelyshev is pretty hot on all things relating to performance, he might be able to give you a good answer. As always though, with all things concerning performance get yourself a reproducible measured test case, preferably in-situ (i.e. if this is for a game, try to test it against your game code) and crack through the different options. ecv 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 6, 2016 Share Posted June 6, 2016 @ecv theoretically, only size on screen matters, number of drawn pixels. ecv 1 Quote Link to comment Share on other sites More sharing options...
Fatalist Posted June 6, 2016 Share Posted June 6, 2016 Actually I found out that texture size does matter, bigger texture is more expensive to draw, even when drawing the same number of pixels. But you can avoid that performance penalty by using mipmaps. Kyros2000GameDev and ecv 2 Quote Link to comment Share on other sites More sharing options...
ecv Posted June 6, 2016 Author Share Posted June 6, 2016 1 minute ago, Fatalist said: Actually I found out that texture size does matter, bigger texture is more expensive to draw, even when drawing the same number of pixels. But you can avoid that performance penalty by using mipmaps. You mean like downscaling a big texture into a little sprite? No idea what mipmaps are yet. Will a low-end device handle a non-moving fullscreen sprite animation (24fps), say at VGA or 800x600? Although I think I'm realizing the pointlessness of this thread, as I've been told, probably profiling is the only valid take on this. Quote Link to comment Share on other sites More sharing options...
Fatalist Posted June 6, 2016 Share Posted June 6, 2016 19 minutes ago, ecv said: You mean like downscaling a big texture into a little sprite? Yes. If you were asking about drawing non-scaled sprites - then bigger is always slower to draw, 2x bigger sprite => ~2x slower to draw. 24 minutes ago, ecv said: Will a low-end device handle a non-moving fullscreen sprite animation (24fps), say at VGA or 800x600? BTW moving sprites around is almost free. They can probably handle that, but download size is gonna be pretty large. For fullscreen animations it might be better to use video files. ecv 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 6, 2016 Share Posted June 6, 2016 If memory is your concern, we can use compressed textures like http://www.celsiusheroes.com/ did. I wrapped their implementation into plugin (v3, ill update to v4 later) https://github.com/pixijs/pixi-compressed-textures Quote Link to comment Share on other sites More sharing options...
Gio Posted June 7, 2016 Share Posted June 7, 2016 I am missing some context here, but if you are using WebGL, then you can generate a mip-chain and use mipmaps, and the size of the source image doesn't matter in terms of performance. However: Your source texture must be a power of two A full mip chain uses 33% more memory than just the source texture It takes longer to load that texture to start with If using a spritesheet, you have to be careful, there may be artefacts near the edges of each sprite at lower mip levels If you use a 2d canvas as opposed to WebGL, the image filtering is way more expensive than the hardware-accelerated filtering that you get with WebGL. As a result it looks much nicer with fewer artefacts, but it's also a lot slower and the source texture size will make a big difference. ecv and Kyros2000GameDev 2 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.