How do I choose an optimal texture size for a mobile Unity game?

| | August 8, 2015

I am developing a 2D game with Unity2D for Android, iOS, WebPlayer and maybe for desktop computers. I think the working resolution of my game is 1280*800.

How do I choose the optimal size of textures? May the textures be high resolution, for example 1920*1080? I read somewhere that it could be bad for devices with a small resolution.

2 Responses to “How do I choose an optimal texture size for a mobile Unity game?”

  1. Basically you have to balance
    – reduced number of draw calls
    – small memory footprint at runtime
    – small application package size (as already said)

    I suggest to organize textures/sprites that are printed in the same scene in “Sprites Atlases” and keep the max resolution of atlases around 1024×1024 or 2048×2048.
    This, combined with some good scripting as NGUI, will reduce drastically your draw calls.
    Also try to organize the sprites based on the “layer” or “depth” they are printed at: for example put in a atlas all GUI sprites and in another all your “character sprites” (especially if you use 2D sprites animations”.

    At the other end if you have big images/texture you want to use as background, it’s generally better to use them as isolated textures and get rid of them when you load another level.

    When importing 2D sprites use advanced mode and disable MIP MAPPING, as you don’t need it (they will be always at the same distance from the camera) and try both Point and Bilinear filter mode and see what gives you the best result.

    If you want the best quality in a wide range of resolution (pixel perfect or near pixel perfect from 320×200 to 1920×1080) you may have to produce multiple versions of the same sprite atlases and decide which one to load at start time (when loading the game the first time).

  2. OriginalDaemon on November 30, -0001 @ 12:00 AM

    There are essentially two things to consider when thinking about the drawback of a larger texture size; performance and build size.

    Large textures are more complex to render so have higher requirements of the hardware.

    Large textures also make the build size much larger which may be an issue when considering the mobile market – mobile devices have less storage and, in the case of smart phones, the users are likely to want to download the application on a mobile broadband connection – 3g/4g etc – where build size often makes a difference in a person’s decision to download an application.

    These two factors need to be balanced with what you consider a minimum graphical quality on each platform.

    The first thing to note in unity is that it’s possible to have platform specific import settings in which you can dictate the maximum resolution for textures on a given platform. This is controlled in the texture importer window. The settings can also be toggled by scripts.

    This page on reducing the build size discusses adjusting texture quality. Essentially it discusses the fact that textures tend to be the largest part of the build, so if the build is too big you should change the texture import settings to set a maximum size.

    If performance is the only issue, the easiest way to adjust for that is to change the quality settings. It has a texture quality option in which you can tell the system to use full, half, quarter or eighth resolution. So for different platforms you could just set this value to something else. I don’t think this affects the build size however.

Leave a Reply