Search Unity

Down-scaling HD sprite vs Having sprites in different resolutions?

Discussion in '2D' started by comeon, Nov 26, 2013.

  1. comeon

    comeon

    Joined:
    Apr 30, 2013
    Posts:
    1
    Hi all, apologies if this has already been answered, but I couldn't really find a clear solution to my problem.

    When doing Android development (many different resolutions) I was planning to have 1 big sprite that I then scale to fit the various devices, but it doesn't look that pretty when I do this. The black lines in my Cartoon Sprite are pixelated and it doesn't look great.

    So my question is if 'down-scaling a high resolution sprite' would ever give good results in Unity on various platforms?

    If not I presume my only option is to have the same sprite in different resolutions and then just pick the most appropriate one based on the device...

    Any thoughts?

    Thanks!
     
  2. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
  3. guykogus

    guykogus

    Joined:
    Aug 12, 2013
    Posts:
    5
    I'm having the same issue. Does anyone know a good way to handle this using Unity's new 2D system?
     
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    Depends on how small the details in your sprite are. Bilinear/trilinear filtering can help somewhat but adds a certain blurriness. Also downscaling generally will add a bit of blur to things. You could consider having one high-res sprite set and then at runtime, at the start of the game, process all the images and scale them down to the exact ideal size and add a little bit of sharpening.. but it will take time to do that so you'd want to do it in the background. It's also possible to generate and upload your own mipmap levels via script if you can draw or generate better quality ones.

    If the range of resolutions is really a lot them you might be better off with 2 or 3 different sets of graphics.
     
  5. guykogus

    guykogus

    Joined:
    Aug 12, 2013
    Posts:
    5
    The question is how to implement the different image sets. I've tried to use the proper Unity setup for my sprites. Here are the steps I took:

    1. Create a Game Object with a Sprite Renderer.
    2. Create an Animator Controller for the object.
    3. Create some Animations where the curve is the Sprite property.
    4. Set up the Animator Controller's state machine to choose the appropriate animations.

    How do I tell the animator to select the sprites for those animations based on different screen resolutions?