Artefacts on the edge of sprites in iOS [solved]

I’m getting artefacts and glitches on the edge of sprites that are only visible when running on an iOS device.
Here is a comparison of how it looks on the device and in the editor:

23965-error.jpg

In that image, each coloured shape is a separate sprite.

I’m using the latest version of Unity 4.3 and all the images Texture Type are set as Sprite.
Filter mode is Point, although I tried with Bilinear with the same results.
All Sprites have a Pixels to Unit ratio of 1.
The format is set to Truecolor, and the original image is a PNG with transparency.
I tried with a Photoshop image too, but I get the same result.

Everything is made to be shown pixel perfect: the orto camera is set up right, each sprite is positioned in exact coordinates without decimal points.
All the sprites are put in sprite sheets with Unity’s new Sprite Packer.

Not all sprites have this problem.
The glitches stay the same if I do a new build on Xcode, but sometimes after working on the project for a while some sprites will now look fine and others get messed up. I think when I repack the sprite sheets the glitches change, but I can’t confirm it.

It happens in different iOS devices, some with retina display and older ones too.

Any suggestions on what is doing it? Or how to fix it?

I searched for a long time for similar problems, but only found things related to the alpha channel (no trouble there) and scaled sprites (I’m not scaling anything).

UPDATE- This bug was fixed in the Unity 4.5 update

So no one else has this problem? I've searched a lot for something like this on Unity Answers and other forums, but I can't find anything similar. Should I report this as a bug?

–

This seems to happen because of the Sprite Packer, If I don't pack them then the glitches disappear. Any comments on this?

–

2 Answers

2

It’s hard to tell but it looks like it might be a UV precision issue. Try to make sure your UVs are as close to [0,1] as possible. You can also try adding a few more rows or columns of verts to your mesh to minimize that artifact.

@MakeCodeNow Thanks for your comment, but I'm using the new sprite system that came with Unity 4.3, so I'm not using meshes or materials. When an image is set up as a Sprite in its Texture Type it can be added directly to the hierarchy.

–

I have the same issue. It’s a bug with the sprite packer.

No proper solution so far.
To get around it: don’t use the sprite packer(set Packaging Tag to empty) or set the Mesh Type to Full Rect. Both are in the Texture Importer Settings

More info here: http://forum.unity3d.com/threads/232000-Artifacts-with-Sprite-Packer-and-mesh-type-TIGHT.

This happened to me in Unity 4.3.3.

Yes, you're right. I found the same thread recently. I also sent a bug report to unity, hopefully they'll take it into consideration for the next release. If anyone else wants to know if its been addressed, check on the link that Twinsen shared.

–