I currently making 2D pixel game and thinking about best practice to use the “right” size of my sprite sheet texture and each sprite size.
- Should i use the POT for the sprite sheet size ?
- Should i use the POT for each sprite size ?
I currently making 2D pixel game and thinking about best practice to use the “right” size of my sprite sheet texture and each sprite size.
POT is not a hard requirement but good if you want to use compression or mip maps, see my post here:
This only applies to textures, i.e. the atlas. Individual sprites on the atlas texture aren’t textures themselves and these concerns don’t apply, you can size them however you want.
Thanks for your answer. Anyway, Is that mean that POT not necessary for pixel game which not using compression and mipmaps ?
POT is only a requirement by some texture formats, such as PVRTC.
Some old hardware also required POT textures because the GPUs back in the day couldn’t work with Non-POT textures. For anything else, POT (in textures) has no relevance.
The only situation where you may have to consider what POT does is wasted disk space / memory. Happens when a spritesheet texture that has to be in POT format (due to format/compression) only marginally exceeds the current POT limit and thus Unity doubles its size (eg goes from 512x512 to 1024x512).
If you know you’ll also fill that space that’s okay but if you know it’s just because of that tiny icon, you may want to consider shuffling some sprites around or play with the packing options.
Thanks for your reply. By the way, is rectangular POT fine ? And how about extreme ratio like 32 x 1024 ?
For example, i’m planing to make a sprite sheet of fruit variant with 32 x 32 as the individual size. In the beginning i just planning to create 4 variant of fruit, so i make the sheet size 32 x 128 but there is a possibility that later i add more variant so the width of sheet could be 512 or even 1024. Is this okay ?
All fine, as long as each dimension is POT. You could even do 2x8192 although I believe some GPUs require a min size of 4, not 2.
In the Unity editor, if a texture doesn’t meet the requirements for compression / mips, the texture is simply uncompressed or mips are disabled. The Unity editor doesn’t pad textures to make them POT, the user has to manually resize them.
This only used to happen once a non-POT texture is loaded on a GPU that requires POT, in which case Unity padded the texture before loading it. But nowadays GPUs support non-POT and I don’t think this is really a concern anymore.
That applies to sprites, but textures are automatically resized to the nearest POT on import, which can be changed in the Advanced settings. However, this doesn’t alter the source asset file, it only affects how Unity processes the image and how it will be included in builds.