Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Alpha image channel not working correctly, transparency inverted

Discussion in 'General Graphics' started by CyVirus, Dec 15, 2014.

  1. CyVirus

    CyVirus

    Joined:
    Nov 18, 2014
    Posts:
    11
    I have tried to make textures with transparency but nothing is working. I've tried making a Alpha layer on the image, but it just gets ignored. I've also tried using all of the types of transparency materials and even the cutout materials. The closest I've gotten is when I edit the image in the Inspector and I check off both "Alpha from Grayscal" and "Alpha is Transparent" and what this does is it makes the white background stay visible, but turns the black and any other darker colours transparent.

    Please help me!
     
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,646
    What format are you saving your textures in? As long as you're using the correct type of shader it's more likely that the alpha channel is getting lost than ignored.
     
    CyVirus likes this.
  3. CyVirus

    CyVirus

    Joined:
    Nov 18, 2014
    Posts:
    11
    I've exported all of my textures from PhotoShop as a .png file
     
  4. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,646
    And it's a 32 bit PNG with an 8 bit alpha channel? Just "PNG" alone doesn't actually describe what the data is. There are plenty of sub-formats.

    If you view it in other applications does the alpha look like you expect?
     
  5. CyVirus

    CyVirus

    Joined:
    Nov 18, 2014
    Posts:
    11
    The image is 64x64 pixels, the resolution is 72.00 pixels/inch, the alpha channel is 8 bit. The only thing that I'm not sure is if the image is 32 bit, but I would think it is.

    I have also checked it on a different application; and yeah, I'm pretty sure you're right. It doesn't show the transparency in the image.

    What other formats do you suggest that I save my textures as?
     
  6. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,646
    Are you using Windows? If so, right click your PNG, go to Properties and then Details. That'll tell you the bit depth.

    Targa or bitmap are also capable of storing the alpha channel. There should be an option for your PNGs to keep it, though. It definitely works, it's my standard format for image data.