Should sprite sheets and sprite sheets atlases be of Power of 2 resolutions?

Hi,

I need to make sprite sheets for several animations in my game. Right now, I have all the frames of each animation to a power of 2 resolution, meaning each frame is either 128x128, 256x256 and so on.

The thing is, for instance, I have a 36 frames animation, which if you multiply 256 x 36 its 9216 if I remember correctly, which its not a power of 2 number, so my question is the following:

What’s the best practice, create animations with power of 2 framing and limit the number of frames in the animation so the sprite sheet is power 2 resoluted as well? Or which one of the resolutions MUST be power of 2, the sprite frame or the sprite sheet/atlas?

thanks in advance for your time!

It depends on your target and compression that you choose.

Some graphics processors required Power Of Two (POT) textures some time ago. I don’t think that this is a hard requirement anymore. E.g. iPhones dropped this with iPhone 3GS. Some low-cost Phones might still require POT.

What you can’t do is making the textures too big. I recommend that you don’t make your textures bigger than 2048x2048. 9216 is a no-go. Most GPUs won’t be able to handle this sizes and you will end up with severe artifacts on the ones that can handle it.

Platform-specific compression might require some constraints. E.g. DXTC must have sizes divisible by 4.
It should not matter if you use Truecolor or 16 bit textures.

Do your animations contain transparency? If so I would propose packing the sprite sheet with some software that removes the transparency while keeping the pivot points. This saves a lot of memory for you. TexturePacker might be a good tool to check - there’s a free importer in the asset store. It also optimizes your sprites for faster drawing.