I have a texture that is 1024x900. Should I resize it in Photoshop to be 1024x1024 or leave it as it is?
What about a texture sized 1000x900?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
Making you textures a power of two is very useful for many reasons:
When it comes to rendering or the computation and usage of mipmaps, making your texture's dimensions powers of two can avoid some gpu headaches, since it could do some optimization internally;
You (or the software you use) are going to have custom extensions made by your gpu's drivers manufacturer if you want them to work consistently on your machine. Using special gpu extensions decreases the game's compatibility since not every machine it's going to run on is probably going to implement what it needs to run on. if you stick with powers of 2 then you are guaranteed multi-platform support and good performance, otherwise you may have problems when you try and work with a different machine other than the one you started on;
Let's make a simple example:
Let's say we have two textures, one is 64x64 and the other is 60x60 pixels big; We want to find a given texel in the texture:
Texel = 64 * s + t
Texel = 60 * s + t
But wait, 64 is a power of two isn't it? That means we can do:
Texel = (s<<6) +t //64 is equal to 2 to the power of 6
In the case of 60, we can't quite simplify this calculation as easily;
Shifting bytes is always going to be faster that multiplying by powers of 2, no matter how fast and clever the calculations we make are.
Other than all this performance-related stuff, power of two textures are also easier to maintain overtime.
Nowdays game engines like Unity can totally handle non power of two textures without much trouble, which is why this is not such a huge issue;
In my experience power of two textures are the best way to make 2D art, since that's exactly what your gpu wants (and expects); also, in terms of maintainability and efficency it's probably the best option in 99% of the cases.