Thursday, December 8, 2022
HomeGame DevelopmentOne Large sprite sheet or smaller particular person sheets? - cocos2d-x

One Large sprite sheet or smaller particular person sheets? – cocos2d-x


Hello there,
Fast query. Is there any advantage of placing all sprites in a single sheet. As an illustration the idle, the stroll, the run, the bounce, the dying, and so on… In a single huge picture and it’s corresponding one knowledge .xml/json file?
Or have a smaller particular person ones: walkSheet.png and walkSheet.json, run sheet.png and runSheet.json and so on…
Any profit from a efficiency standpoint or it simply s matter of desire?

Thanks


Put as a lot as you may on a single sprite sheet. If every little thing can match on a single sprite sheet, then that might imply a single draw name from CPU to the GPU; mainly, no want for the CPU to waste time transferring knowledge throughout to the GPU. The extra draw calls you may have, the extra time you waste, and the decrease your body fee, though it’s possible you’ll not discover this except you’re switching out massive textures or plenty of them.

Within the instance you gave, with idle, stroll, run and so on., you’d wish to swap out and in of the totally different animations in a short time, so to keep away from must consistently ship totally different knowledge to the GPU every time (which means extra draw calls), simply match all of them on a sprite sheet.

If I keep in mind appropriately, all present GPUs help a sprite sheet measurement of 2048×2048, and a few may even deal with 4096×4096 or bigger, however you would wish to detect this in some way and use the proper set of sprite sheets if you’ll attempt to use something bigger than 2048×2048.

When you do an online seek for the explanations to make use of sprite sheets, then I’m sure you’d have all the knowledge you require about this subject. As an illustration, the useful data right here.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments