Hello Guest

Author Topic: White border around sprite  (Read 6051 times)

Hapistorique

  • Newbie
  • *
  • Posts: 10
    • View Profile
White border around sprite
« 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 :



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 :


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
« Last Edit: December 08, 2012, 10:24:31 pm by Hapistorique »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: White border around sprite
« Reply #1 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.

Hapistorique

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: White border around sprite
« Reply #2 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: White border around sprite
« Reply #3 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.

Hapistorique

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: White border around sprite
« Reply #4 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.

:(

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: White border around sprite
« Reply #5 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