2D Toolkit Forum

2D Toolkit => Support => Topic started by: Hapistorique on December 08, 2012, 09:39:48 pm

Title: White border around sprite
Post by: Hapistorique on December 08, 2012, 09:39:48 pm
Hey,

I have a problem when importing a sprite in Unity and TK2d : there is a small border of 1px around some part of the sprite, like this :

(http://i.imgur.com/1tB1j.png)

It happens only when the background of the imported image is white in the inspector, but I don't see the reason of this, I'm importing all the images in .png made with photoshop

Do you have any idea on how to fix this ? :/


EDIT : by using the "point" filter I'm getting better result but I'm still getting white points on it :
(http://i.imgur.com/poibv.jpg)

EDIT 2 : Tried the tk2d camera, but I don't know if it's worth it ? The problem disapear but it's still not perfect, the black pixels are off
(http://i.imgur.com/jVqBV.png)
Title: Re: White border around sprite
Post by: unikronsoftware on December 09, 2012, 05:55:31 am
This is an issue with your source artwork (or rather, the application saving it out) - the easiest way is to work around this is to use premultipled alpha. Turn it on in the sprite collection editor, and then switch your atlas material to
PremulVertexColor.
Title: Re: White border around sprite
Post by: Hapistorique on December 09, 2012, 03:38:09 pm
How should the files be exported ?

I am just saving sprites as .png with a transparent background
Title: Re: White border around sprite
Post by: unikronsoftware on December 10, 2012, 12:50:42 pm
Here is an explanation of why it happens:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,189.msg693.html#msg693

Hope it gives you a lot more insight into this. It is a common issue with textures with alpha where filtering is used, and the texture is scaled up.
Title: Re: White border around sprite
Post by: Hapistorique on December 10, 2012, 11:14:14 pm
I can't access the link you gave

Quote
An Error Has Occurred!
The topic or board you are looking for appears to be either missing or off limits to you.

:(
Title: Re: White border around sprite
Post by: unikronsoftware on December 11, 2012, 01:11:48 am
Ah. Its in the private support forum. You'll need to register as shown here to get access:
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,34.0.html