Hi - I have come across this issue a number of times and have always hacked around it but was wondering if there is a proper solution or if this is a bug in unity. Basically if i have an atlased sprite that I want to slice horizontally (i.e. the top and bottom borders are set to 0 in the sprite editor) and it has some empty space above or below it in the source image. I end up with the sprite above or below in the atlas bleeding into this empty space:
If I change the image type to simple the problem goes away.
If I add vertical slicing by setting a top border that excludes the empty space the problem goes away.
I know that when the sprites are packed onto the atlas the empty space is removed and presumably something is done at run time to account for this, it seems like there is a bug in this accounting in this situation.
That’s interesting, I’ve never used / needed atlas maps so far…
So if you frame your door / panel tightly, then everything is OK? If this is the case, seems like atlas packing does not notice empty space that you want to have in your panel, but instead of this, it just creates tightly framed bounding box around your art and uses it to pack your art to texture sheet… yet it then uses the bbox you made for UVs / rendering…
Yep that is correct and this is very nice behaviour in many cases for example if we have a layered bit of UI then an artist can just export the layers with empty space around them, then in game they are very easy to layout in the correct relative positions because they are the same size, but internally unity will only be drawing quads of the same size as the area that has content so you don’t waste any fill rate.
I don’t know if unity also does this with non-atlased sprites but I don’t see why not (the bleeding obviously wouldn’t be an issue here)