Author Topic: NGUI incorrectly adding shadows to transparent pngs?  (Read 4040 times)

patrickkidd

  • Guest
NGUI incorrectly adding shadows to transparent pngs?
« on: August 18, 2013, 10:53:26 PM »
I am adding transparent PNGs to my atlas and finding that NGUI is replacing some of the semi-transparent white around the outsides with a dark color, which makes it look like a shadow. Is there any way to get NGUI to use the exact pixel data in the image to it looks the same as the artist designed it?

I've attached 2 of the originals with white highlights around the top edge, the intended noisy-white background image, and the generated atlas texture with the white highlights replaced by darker highlights as generated by NGUI.

Thanks!

lime-green.at

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 60
    • View Profile
Re: NGUI incorrectly adding shadows to transparent pngs?
« Reply #1 on: August 19, 2013, 01:23:48 AM »
Tested it, can't see the problem:


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI incorrectly adding shadows to transparent pngs?
« Reply #2 on: August 19, 2013, 09:06:17 AM »
You need to use Unity 4.2+ if you're using PNGs, and have "alpha is transparency" checkbox checked on texture import settings.

PNGs treat transparent pixels as white color by default.

patrickkidd

  • Guest
Re: NGUI incorrectly adding shadows to transparent pngs?
« Reply #3 on: August 19, 2013, 01:07:30 PM »
I upgraded to 4.2 and that fixed it. Thanks!