2D Toolkit Forum

2D Toolkit => Support => Topic started by: mamamia on May 19, 2013, 10:34:34 pm

Title: How could I solve this bleeding issue (have used extend mode with some paddings)
Post by: mamamia on May 19, 2013, 10:34:34 pm
Hi,

I have a little problem with my sprites. Below you can see a picture of one of my sprites (it has been cut from the scene, so, a green background is seen). As you can see when using bilinear sampling a white border appears in the curved side of the piece. This part of the sprite is transparent. I have tried to fix it using extend mode with some differnet pixel padding ammounts without luck. Other modes behave worse.

Could anybody please give any tip to avoid this?.

Thanks in advance.

Title: Re: How could I solve this bleeding issue (have used extend mode with some paddings)
Post by: unikronsoftware on May 19, 2013, 10:56:09 pm
This is caused by an issue with your source asset.
Easy way out - use premultiplied alpha.

1. In sprite collection settings, tick use premultiplied alpha.
2. Commit
3. Find the material used by the sprite collection, and switch the material type to tk2d/PremulVertexColor.

It should look a lot better now.
Title: Re: How could I solve this bleeding issue (have used extend mode with some paddings)
Post by: mamamia on May 20, 2013, 08:24:59 am
Hi!,

Thanks a lot for the tip unikron. Haven't yet tried your tip because I'm not at home.

Would you mind comment which is the problem with the asset (just to understand why is this happening)?.

Thanks in advance.
Title: Re: How could I solve this bleeding issue (have used extend mode with some paddings)
Post by: unikronsoftware on May 20, 2013, 01:03:46 pm
I wrote an explanation a long time ago.
Link: http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,189.msg693.html#msg693
Title: Re: How could I solve this bleeding issue (have used extend mode with some paddings)
Post by: mamamia on May 20, 2013, 10:51:00 pm
Thanks for the explanation.