Search Unity

Does non-power-two Texture2D slow down the performance in 2D game?

Discussion in '2D' started by tiny2014, Jul 21, 2014.

  1. tiny2014

    tiny2014

    Joined:
    Jun 28, 2014
    Posts:
    13
    if not ,then i don't need to think about convert 2D sprite into 256*256 512*512 1024*1024 etc............

    I have read something ,it says in unity ,non-power-two texture do some slow-down in 3D game. But is it the same in 2D game?
     
  2. cbothra

    cbothra

    Joined:
    Mar 14, 2014
    Posts:
    125
    As a general conception its right that non-power-2D texture slows down the performance, as I dont have the exact link but I can remember that somewhere I've read that at first those are converted in the power of 2 and then rendered on the screen which increases the CPU.
     
  3. David-Berger

    David-Berger

    Unity Technologies

    Joined:
    Jul 16, 2014
    Posts:
    745
    Both of you have some good points to line out.

    It mainly depends on the platform you deploy the project to at the moment. If full nPOT textures are available without costs depends mainly on the graphics driver/hardware e.g. iOS where you can have full nPOT support in ESGL 3.0 but not in versions 2.0 or 1.1 or below. Further information can be found here.

    At all it will cost you much more memory as more space is needed to store larger textures as they get filled with nothing to be nPOT, but it will also increase the memory bandwidth as the data needs to be transfered to the GPU. That is where texture packing comes in. For more information about 2D Textures (applies to 2D and 3D) in Unity read here.
    When it comes to 2D, things are a little bit different. Due to the fact, that there are many platforms on the market which do not support full nPOT textures, especially mobile ones, you still should use n-powered textures. In many cases you will use a texture atlas combined with batched sprites anyways for your game and a texture atlas is normally a quite big n-powered texture to save time and memory.

    If you need some more information on hardware spreads, there is a nice collection about this collected by Unity here.