Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2x, 3x, 1x etc image assets?

Discussion in 'iOS and tvOS' started by Umai, Dec 29, 2014.

  1. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    I'm developing a 2D game here and there is one big mystery with Unity remaining (well, actually there are a few more).

    How do we make sure that our game loads 1x, 2x, 3x etc resolution imagery as needed for each device screen resolution? For instance, a 3x image squeezed down at runtime to 1x on an iPad mini does NOT look good. Even a 2x squeezed down to 1x does not look very good at all...
     
  2. Veemix

    Veemix

    Joined:
    Dec 5, 2014
    Posts:
    25
    iOS can select the appropriate image resolution for a given device if you append "@2x" or "@3x" to the filename. So if your original image at 1x resolution is named water.png, you should bundle the higher res versions as water@2x.png and water@3x.png. More info here.
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, Unity doesn't support anything like that. There are no .png files used at all, aside from importing into the editor. I haven't had issues with just scaling things down.

    --Eric
     
  4. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    So every developer who wants to provide 2D assets need to somehow invent this? I believe for other mobile platforms as well you need to provide 2D assets in multiple resolutions in order to have a crisp result. In some cases autoscaling big art down to fit on tiny screen resolutions might work but in many cases not, especially if you target iOS where you need to provide 3x, 2x, and 1x assets.

    This is still very much a mystery to me.
     
  5. shaderop

    shaderop

    Joined:
    Nov 24, 2010
    Posts:
    942
    Yes, you're absolutely correct. When it comes to textures and 2D, you're on your own as far as handling different DPIs. The easiest solution would be to invest in buying 2D Toolkit. It has support for this feature and much, much more. Worth every penny.