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. Dismiss Notice

Tiles from SpriteSheet have shading on the edges

Discussion in '2D' started by dapost, Aug 3, 2022.

  1. dapost

    dapost

    Joined:
    Feb 22, 2022
    Posts:
    3
    Using a sprite sheet, I am able to create the individual sprites in the Sprite editor. There is no shading on the edges of these sprites (16px x 16px, separated by 1px, doing the auto slice cuts everything as I wish):
    upload_2022-8-2_22-1-37.png
    Looks great (shout out to Kenney). However, when I import them into a tile palette, they seem to lose some of their sharpness on the edges:
    upload_2022-8-2_22-3-8.png

    Maybe that's just the grid making it look weird? Well, when I paint them on the grid, I get this result in play mode (grid turned off jumping back into the scene view):
    upload_2022-8-2_22-4-18.png

    Really zooming in, you can see the tiles are indeed touching, with the weird shading tacked on. The top of each tile is the only side that does not have it:
    upload_2022-8-2_22-6-44.png

    I've been banging my head on this issue for a while and the few tutorials I surfed didn't seem to have this problem. The internet also doesn't seem to have this issue though I may be searching the wrong keywords.
    I've tried numerous things, but since I don't want to rule anything out, I'll not say anything for now (though I did go into graphics in project settings and turned off the Universal Renderer (set to None) to no avail). I also have this issue when trying to use the sprites while scripting.

    Here is the SpriteSheet from the inspector:
    upload_2022-8-2_22-9-19.png

    Clicking on the individual sprites from the spritesheet shows what I expect it to look like in the inspector.
     
  2. dapost

    dapost

    Joined:
    Feb 22, 2022
    Posts:
    3
    So changing Filter Mode to Point (no filter) fixed this for me. Can anyone tell me why Bilinear is the default, and why nobody seems to he having this problem? Is it a problem with my png of the spritesheet, am I an idiot, what is the differences between the three Filter Modes? Any quips or useful advice is greatly appreciated.

    Edit:
    I did read the three descriptions in the docs.
    Bilinear: texture samples are averaged.
    I see nothing that tells me the shading on the edges should be averaged. It's all green. Manually bringing the box in so that it has green on the outside of the slice results in the same shading. I am in unity 2020.3, doing other spritesheets I did not notice this problem. Any explanations would make me happy.
     
    Last edited: Aug 3, 2022
  3. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    its because unity is a 3d engine and bilinear is a standard for 3d

    point filter is only used for pixel art games

    tons of ppl have this same problem when starting out, if you check these forums you will see a ton of posts asking questions like:

    " why does my pixel art look blurry?"

    also ill save you some time for the next problems youre gonna have:

    set your compression to none or your colors will be messed up
    create a sprite atlas and add padding of 2 or you will get lines between your tiles
    if you are going for pixel perfect then you will have a hell of a ride
     
    Last edited: Aug 3, 2022
  4. dapost

    dapost

    Joined:
    Feb 22, 2022
    Posts:
    3
    I did immediately run into the weird lines and compression issue, but that one i was able to find, and then the blurry keyword popped up and I found links to the issue I had in this post. Even the 2d pixel perfect docs had the no point setting highlighted. So I just didn't know what I was searching for, live and learn I guess, thanks for the response!