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?

  • 1
    \$\begingroup\$ It depends what effect you want / what problem you want to solve. As you've probably noticed, Unity can handle non-power-of-two textures just fine in many cases. Have you observed a specific issue in your current case that you're hoping to solve by changing the texture size? \$\endgroup\$
    – DMGregory
    Feb 10, 2019 at 17:12
  • \$\begingroup\$ I have not noticed any problems. I am currently just sorting all my textures. \$\endgroup\$
    – AzulShiva
    Feb 11, 2019 at 7:58
  • \$\begingroup\$ If you haven't noticed any problems, then it's probably fine for your needs as-is \$\endgroup\$
    – DMGregory
    Feb 11, 2019 at 10:31
  • \$\begingroup\$ I personally believe that power-of-two textures are a cargo cult originating from before OpenGL 2.0 (released in 2004) when textures had to be powers of two. But perhaps I should try to falsify my believe by running a couple tests and posting the results as an answer. \$\endgroup\$
    – Philipp
    Dec 7, 2020 at 14:53

1 Answer 1


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.

  • 4
    \$\begingroup\$ Your answer doesn't seem to take Unity into account. How does it deal with non-power of 2 textures? Do they affect performance or portability? Maybe Unity is applying some workaround internally? BTW, the the bit-shifting you've shown is an example of optimisation that you shouldn't apply. Compiler would figure it out by itself and writing it explicitly hurts readability. \$\endgroup\$
    – gronostaj
    Feb 11, 2019 at 6:03
  • \$\begingroup\$ @gronostaj I can't speak for Unity since i cannot (an don't) read the source code. As I explained in my answer, non power of 2 textures are more computationally expensive and are generally less portable. Unity takes care of most of this stuff internally, but it's still important to know its limitations. The example shows how the compiler could have handled both cases, not the most efficient way ;) \$\endgroup\$
    – user115399
    Feb 11, 2019 at 6:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .