So, I am trying to figure out, is there an optimal size for sprites? my tests are not really seeing a huge difference in fps, just memory used. 16x16, 32x32, 128x128, etc, etc.
I am trying to make sprites that are made of up to 5-10 parts, to make it easier to swap them during gameplay. But I want to know whats most optimized in terms of power 2 sizes within the sheet to render from.
RimWorld does 128x128 for a lot of its parts.
My guess is the renderer is going to take the same time but use X amount of memory to process any sheet under say 1028x1028? or am I mistaken?
MipMaps are also a factor. Let’s say your 128x128 sprites are zoomed out so on the screen they’re really 1/4 that size. Well, the GPU can do less work if it can pick out the correct mip level. This advantage, however, comes at a cost of 33% more memory. If your player has the ability to zoom in and out it’s something to consider. With a fixed camera zoom, it may be unnecessary.
I am confused, how do we maximize the benefits of batching and material sharing, it seems to be from what I read, share materials using least amount of sprite sheets.
It will tell you why two things did not batch. This should give you a guide for what things could productively be combined into a shared spritesheet, if they can share the same material. If they can’t (some special material or shader difference) then there’s no need to try to merge them since that batch is broken anyway.
all of my games usually use just one sprite sheet for the entire game, that only requires one material (the default sprite material assigned by unity to sprites) - for example in the pinball game (listed in my sig below), all sprites are handled in 1 draw call, all sprites are placed on a 2048x2048px psd.