Author Topic: Sprite Atlas Transparency Issues  (Read 11140 times)

BusterTFuzz

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Sprite Atlas Transparency Issues
« on: December 27, 2017, 12:58:06 AM »
I am having difficulties with my sprite transparencies. In some cases, I am getting artifacts.
In other cases, the transparency is correct in the scene window before execution, but not in the game or scene window at run time

I am uploading some images. Any insight would be appreciated.

I am using what I believe is the latest version of NGUI. I am running Unity 2017.1.1f1.

I have tried re-importing my images and toggling the Alpha is transparent flag as well.

There are effectively two issues:

1. Artifacts appearing where there should be transparency.
2. Lack of transparency, and getting black.

In all cases the images as PNG files with transparency in them.

I have enclosed some screen captures.

Thank you in advance









andrejvojtas

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 19
    • View Profile
Re: Sprite Atlas Transparency Issues
« Reply #1 on: January 19, 2018, 11:26:27 AM »
I'm also having issues with transparency in atlas creation. The resulting image is a 24-bit PNG instead of a 32-bit one, so the alpha is completely discarded. Furthermore, the "Alpha Is Transparency" toggle gets unchecked on all the textures that are added to an atlas, which disables their transparency. This means if they're used elsewhere in the project, they lose their transparency and this also breaks Unity's preview of some textures - for instance completely white icons, where only alpha channel varies become completely white and it's impossible to visually tell them apart.

Using Unity 2017.3.0f3 + NGUI 3.11.4. Attaching the actual output and the source images I arranged in what would be a desired result (checkerboard added for emphasis).

Pfaff

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: Sprite Atlas Transparency Issues
« Reply #2 on: January 28, 2018, 09:52:35 AM »
Same problem with sprite transparencies. I'm getting artifacts left and right. Tried playing around with the setting, but nothing solved the issue. I'd appreciate any suggestion on how to sort this out.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: Sprite Atlas Transparency Issues
« Reply #3 on: January 31, 2018, 06:14:40 PM »
If you're trying to use sprites for both NGUI and in Unity, why not use a Unity 2D Sprite instead of an NGUI atlas?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Sprite Atlas Transparency Issues
« Reply #4 on: February 10, 2018, 07:42:20 AM »
If you're using photoshop to output it, then it's likely that you're using an alpha channel but still have some transparency inside the normal layers - this makes the baked version Unity makes use the transparency from the layers, not the channel. You can either drop the alpha channel and bake the transparency directly into the layers, or make a background layer that fills the whole picture with color.