2D Toolkit Forum

2D Toolkit => Support => Topic started by: ehudros on December 23, 2013, 02:55:47 pm

Title: White noise/lines in transparent sprite areas
Post by: ehudros on December 23, 2013, 02:55:47 pm
Hi everyone,
I've created a Sprite Collection from a couple of transparent png's, and when I add them to the stage I see a lot of white lines where they should have been transparent:
http://i.imgur.com/nCghmcD.png.
This only happens when I pick "unity texture" and goes away only if I pick "png" with premultiplied alpha.
Any idea what's causing this? This doesn't happen if I simply drag the sprite to the stage and use Unity's built in Sprite Renderer.

Thanks! :)
Title: Re: White noise/lines in transparent sprite areas
Post by: unikronsoftware on December 24, 2013, 12:03:02 pm
It looks like perhaps your sprite collection set to premultiplied alpha, and you're not using a premultipliued alpha shader? If that isn't the case, could you create a stripped down repro case for this? Will be a lot easier to work out the issue when there is something to look at :)
Title: Re: White noise/lines in transparent sprite areas
Post by: TribalInstincts on January 26, 2014, 08:30:37 pm
I am actually having this same issue though mine is with the toolkit demos themselves. I JUST purchased the toolkit and have not modified anything. Most demo scenes appear to have this issue in one way or another. Any ideas what's wrong?

(http://oi39.tinypic.com/2l8zw60.jpg)
(http://oi43.tinypic.com/2n7o7tf.jpg)
Title: Re: White noise/lines in transparent sprite areas
Post by: unikronsoftware on January 27, 2014, 12:34:55 pm
Yes! I worked it out from the previous issue. Unity 4.3 does some funky non-backwards-compatible stuff if you import a package made in pre-4.3, only when you create the project with "2D" defaults. It treats all imported textures as "alpha is transparency" which breaks what tk2d does there. The issue is that its modifying an already valid texture :(

tk2d 2.4 will detect this and prompts you to change it, but for now you can create your project in "3D" mode, it doesn't really affect anything you do, or you can select all the demo atlas textures and untick Alpha is Transparency & Apply. For this tillemap demo, the texture is at tk2dTileMap_Demo/Demo1/TilemapdemoSpriteCollection Data/atlas0.png.