Hello Guest

Author Topic: White noise/lines in transparent sprite areas  (Read 5819 times)

ehudros

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
White noise/lines in transparent sprite areas
« 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! :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: White noise/lines in transparent sprite areas
« Reply #1 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 :)

TribalInstincts

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: White noise/lines in transparent sprite areas
« Reply #2 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?



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: White noise/lines in transparent sprite areas
« Reply #3 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.