Why are pixels "leaking" from behind my texture?

See image:

2695304--190797--Screen Shot 2016-06-26 at 4.39.40 PM.png

I created a solid red "collider" image, then painted tiles over it. I confirmed the pixel -> 1.0 ratio is exactly 32 pixels (the width of the test texture).

I was able to "fake" it by reducing the pixels -> 1.0 unit scale to 31... but this causes other issues, such as the tiles being slightly the wrong size.

2695317--190798--Screen Shot 2016-06-26 at 4.54.49 PM.png

I'm having the same issue, also when using 32x32 tiles.

Try setting the Sprites filter mode to Point.
Also, try setting format to True Color instead of compressed.
Compression/Filtering can lead to pixel bleeding.

Thanks for your reply, Johaness. I have my sprite sheet set up just as you said and I'm still having the issue.

Perhaps it has something to do with the multiple sprite slicing? I used automatic grid based slicing...32x32 with no padding as that's how the sprite sheet is set up.

I think it's also worth pointing out that it seems to be somewhat random. I can use the same tiles in different places and sometimes there will be a line of background pixels bleeding through, and sometimes there won't. I've had this problem with past versions of Unity as well unfortunately.

When I set the sprite mode to "point" it was greatly improved.

I could not find the Format option though.


2704859--191690--upload_2016-7-3_12-42-11.gif

2704859--191689--upload_2016-7-3_12-40-34.gif

That entire section is disabled for me. ^^


:face_with_spiral_eyes: Could you post an screenshot?
Seems strange to me, never happened before to me :)

2704870--191691--Screen Shot 2016-07-03 at 12.56.23 PM.png
2704870--191691--Screen Shot 2016-07-03 at 12.56.23 PM.png

Yes, what i was expecting, easy fix :P check override for standalone hahaha
You can also click default and change it there

So i have to select "default" in the header? ok.

Pack your sprites into an atlas to fix bleeding. You just need to enter something into the packing field tag to put them in an atlas.

They are already in an Atlas, I think? Do you mean I need unity to repack them?


If you have the atlas tag filled in and you have sprite packer always enabled then they will be in an atlas, which would mean that's not the problem. The sprite packer setting is in Edit -> Project Settings -> Editor.

Edit: Also, make sure you are using the DefaultPackerPolicy. I get bleeding when I use the other ones. The setting for that is in the sprite packer window.

1 Like

Alright, I tried this out and it seemed to work!

1 Like

I ran into a similar problem, the solution was to disable anti-aliasing in Project Settings->Quality Settings under Rendering.

2 Likes

This seems like a poor workflow for something most 2D games will want, will there be some work done to make this seamless?

Or should we write our own, maybe read the asset name and if we match "tilemap" we set the correct import settings?


the problem is due to how we sample the pixels and if you don't leave any transparent borders, there are steps to take the change how the pixels are sampled.

What you are alluding to is probably what we call the "one click solution to get pixel perfect mode"... we are still thinking how this could be done... not sure yet. Do share if you have some ideas.

2 Likes

I found that if I up the "Max Size", it helps significantly. It usually solves the problem for me.