Search Unity

Why do my sprites look jaggy when running a game?

Discussion in '2D' started by rhys_d, Feb 19, 2019.

  1. rhys_d

    rhys_d

    Joined:
    Feb 19, 2019
    Posts:
    17
    I have encountered an issue where in the 'scene' my sprites look completely normal and as they should but when I run the game, they become distorted and jaggy. Does anyone know why? upload_2019-2-19_19-49-51.png upload_2019-2-19_19-50-10.png
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    My guess is that you're either rendering them on a Canvas with the "pixel perfect" setting turned on, or you are using the "Point (no filter) filter on your sprites.

    You can automatically make jagged edges appear soft using anti-aliasing. Either turn on Anti-Aliasing in Quality Settings, turn on MSAA on your cameras, or use an anti-aliasing asset from the asset store. There is good anti-aliasing built into the official Unity Post Processing Stack for free on the asset store.
     
  3. rhys_d

    rhys_d

    Joined:
    Feb 19, 2019
    Posts:
    17
    Hello Thanks for the help. Do you know how to turn off the pixel perfect setting. I thought you had to use the point filter or the sprites look blurry.
     
  4. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    There is a "Pixel Perfect" setting on any Canvas Component (search your scene for "t:Canvas"). Non-UI elements should not be affected.

    "Blurry" may sound bad, but games often make some things blurry to hide imperfections. The whole purpose of Anti-aliasing is to blur the rough edges around objects so players have a harder time noticing individual pixels. The bilinear filter does make thing slightly blurry, but the results are really good. The Point filter is more for when you prefer rough edges to smooth images. Undertale is a great example of a game that would want to use a Point filter, as everything is intentionally pixellated.