Author Topic: Adding Sprites into Atlas gives them a strange background/border  (Read 8199 times)

mimminito

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Adding Sprites into Atlas gives them a strange background/border
« on: November 28, 2013, 05:01:14 AM »
Hi,

After updating to 3.0.6, when adding stuff into an Atlas I already had made in a prior version (still 3.x), I am now getting a weird background/border appearing behind the sprite when shown in the game. In the preview screen its fine, but when I add it to the scene, its got this weird background/border effect. It looks like a large square border. Also, when I view the Texture created by the atlas, I can see the issue in there as well.

I then tried to create a new Atlas, and start adding in my textures, and when viewed, they are all ok! So there is some issue with the upgrade process here which has messed up my old atlas. Any suggestions?

Adam

romeo_ftv

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 4
    • View Profile
Re: Adding Sprites into Atlas gives them a strange background/border
« Reply #1 on: November 28, 2013, 05:21:44 AM »
I have the same issue.

zazery

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 26
    • View Profile
Re: Adding Sprites into Atlas gives them a strange background/border
« Reply #2 on: November 28, 2013, 05:36:26 AM »
Sounds like pre-multiplied alpha was unchecked on the Atlas Manager. I noticed it when I updated NGUI recently. In the Atlas Maker window make sure PMA Shader is checked.

mimminito

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 30
    • View Profile
Re: Adding Sprites into Atlas gives them a strange background/border
« Reply #3 on: November 28, 2013, 06:42:45 AM »
Yeah, that with a couple of other changes to the texture and shader, and all was working again.

I dont like saying this, but the latest releases of NGUI have not been stable at all, and have caused more issues than features added!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Adding Sprites into Atlas gives them a strange background/border
« Reply #4 on: November 28, 2013, 02:59:47 PM »
PMA option on the atlas should only be used with a PMA shader. If you check the PMA checkbox on the atlas maker and your atlas is not using a PMA shader (PMA = Pre-Multiply Alpha), then you are going to get strange results.

Also, make sure that "Alpha is Transparency" is checked on your atlas texture.

P.S. PMA stuff hasn't changed since ~2.5.0