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.

Question Sprites Have Weird Outline Next To Other Sprites?

Discussion in 'General Graphics' started by Payaso_Prince, Feb 10, 2022.

  1. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    91
    Hello All,

    For some reason my sprites have a weird white outline when aligned with another sprite. They repeat perfectly in PS and I'm only seeing this in Unity.
    Is there a way to remove this? (Note: This is not a gap between the sprites)
     
    Last edited: Feb 10, 2022
  2. mabulous

    mabulous

    Joined:
    Jan 4, 2013
    Posts:
    198
    Without more info, it could be a bunch of things.

    Disable mipmap generation and make sure your texture doesn't get rescaled by unity (select npot if it is npot and set it to maximum res). If this fixes it, it's a texture filtering problem and we can look into it more closely.

    disable MSAA antialiasing. If that results in individual white pixels between your sprites, then the (post-transform) vertices of your sprites are not aligned perfectly.

    If you rely on shader based anti-aliasing, it may be a problem with that.
     
    Last edited: Feb 10, 2022
    Payaso_Prince likes this.
  3. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    91
    Thanks for the reply Mabulous!

    I don't believe I'm doing any of those things but I could be wrong.
    Here's a SS of the inspector:


    Not relying on a shader either. Just using the default.

    Anything stand out to you?
     
  4. mabulous

    mabulous

    Joined:
    Jan 4, 2013
    Posts:
    198
    So what's the actual resolution of the texture file?
     
    Payaso_Prince likes this.
  5. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    91
    The resolution is 1024 x 1080.
     
  6. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,328
    What happens if you make it 1024x1024
     
  7. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    91
    The same issue happens for 1024x1024.
    Curious why you suggested it though
     
  8. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    296
    Filter mode: bilinear switch -> no filter, does that make it go away?

    if the software was doing a resizing it could have improperly filtered alpha into color/rgb and made a ghosting edge
     
    Payaso_Prince likes this.
  9. Payaso_Prince

    Payaso_Prince

    Joined:
    Jul 17, 2017
    Posts:
    91
    Hey thanks for the response!
    Unfortunately, switching bilinear switch -> no filter didn't resolve this :(
     
  10. Torbach78

    Torbach78

    Joined:
    Aug 10, 2013
    Posts:
    296
    the only other unity setting I can think of is the compression is doing something.

    otherwise i'd check to make sure the texture has a perfect alpha, if you resize an image in Photoshop it can blur your alpha and then the alpha could be causing a small line of transparency

    in fact try disabling the image 'import transparency'
    use an opaque material,
    it goes away it is the alpha channel

    or adjust your background image settings to something like bright red : see if it that bright red is bleeding through.
     
  11. mabulous

    mabulous

    Joined:
    Jan 4, 2013
    Posts:
    198
    Did you check about disabling antialiasing as suggested as well? it could be that the vertices of sprites don't match up exactly and you're seeing a thin, anti-aliased gap. Otherwise it would also help us investigate if you could share the raw texture file you're using.
     
  12. unity_48CEDB9C94B428023987

    unity_48CEDB9C94B428023987

    Joined:
    Sep 28, 2021
    Posts:
    6
    That helped in my case. Thank you very much!