I have always tried to get my sprites to fit tightly into my sprite sheets so that I could reduce the amount of memory I’m wasting, but there’s a few conventions I’m wondering if I am adhering to more than I need to, and causing un-do effort.
First of all, do I really gain anything by having my sprite sheets fit into powers of two?
I understand that (at least with most engines) any texture whose dimensions are not in a power of two will waste memory because it get stored in the engine as the next-biggest power of two. Because that’s how graphics cards work and the formats they use.
But is this still a valid issue with sprites in Unity? Does the system still ultimately feed everything to the renderer that way, or is there something with how Unity renders sprites that negates that concept? After all, we split sprite sheets into these individual sprites that are all kinds of different sizes. Would it make a difference if my source image was an odd size?
Second of all, just how much waste goes into wasted space? To make animation easier, I try to make my sprites anchored into the center point. This results in a lot of empty space around the sprite. I’ve been trying to work out frames that could be anchored to different points, which fits more sprites into a single image, but it creates more effort on my end and increases the chances that I might screw something up.
But how much space does empty space actually take up, and what kind of situations do I really want to avoid to increase the optimization of empty space?
I can reposition my anchors for each frame and possibly reduce the total number of sprite sheets by one or two, or I could put my sprites into large cells that are easy to set up, but will take up more sheets filled with a lot of empty space. Or I could even organize my sheets into individual animations, which would be very easy to work with, but results in many more sheets, all of which have lots of empty space. In all three of these situations the actual amount of real-sprite-image is the same, but the amount of empty space varies greatly. What kind of impact do they have on the memory requirements?
I’m not concerned about the size my source files take up, but I want to reduce the amount of memory the game requires.