For the longest time I’ve been told that I need to keep my texture sizes as powers of 2 because this is how graphics cards need data fed to them, and if I had a texture that wasn’t a power of two the engine has to convert it to a power of two, so really you’re just wasting space that you could have used.
But I’m curious how well this applies to 2D assets; for images that I’m plugging in to my game as 2D assets, things I’m using for sprites and for HUD elements. I was assuming they had the same restrictions, but they are going through a different process to get drawn on the screen. Sprite sheets get cut up into several different sprites that are handled like individual images. Textures fed to the HUD are not being ran through the same deformations as ones rendered on a polygonal object’s material.
It’s just different enough that I want to be sure if there is actually a point to constraining myself to these dimensions.
And as a follow-up question, what are the most important things to do to maximize efficiency and resources if I have sprites that absolutely cannot fit neatly into dimensions that are powers of two? For example, if a particular object’s sprites are 48 pixels wide, I simply cannot fit all these sprites onto a single sheet without having gaps on the edge. But while there is wasted space in the image file, how does this translate into the actual performance on the final device?
Would it be smarter to make one giant sheet and cram in as many different sprites as I can to minimize wasted space, or would it be smarter to use smaller sheets to keep each asset separate, even if many parts of the game will always require several groups of these? (For example, having two different sheets of common sprites for the player, another sheet with the player’s weapon effects, even though the game will basically never not require all of these sheets.)
At what point do I face diminishing returns with compacting my sprites together for efficiency? At what point do I face diminishing returns for separating my sprites for efficiency?