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

Question Alpha channel not working on standard shader

Discussion in 'Editor & General Support' started by KRWatkins, Oct 25, 2023.

  1. KRWatkins

    KRWatkins

    Joined:
    Jun 25, 2019
    Posts:
    6
    I'm unsure what I am doing incorrectly, I've created transparent materials before with success. At first I used Gimp and followed a tutorial as I am not great with Gimp. When that didn't work I used Substance Designer since I'm more familiar with that yet that didn't change anything. I have the texture set as Input Texture Alpha for the source and Alpha is Transparency is checked. The standard shader is set to Transparent.


    I'm using the standard pipeline in unity 2022.2.9. Below are some screen grabs from the various steps I described above. When I adjust the Alpha slider the whole material becomes transparent rather than just the sections determined by the alpha channel. What gives? Thanks for for any help.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,974
    Check that the image file you import actually shows transparency if you open it with a regular viewer or as the exported file format. What you think is alpha may not actually be alpha, eg fully transparent. I often have this issue with Paint.Net where you cannot simply "draw alpha", or at least I haven't figured it out. Typically you'd have a bottom layer that is transparent (empty) and then you draw on top layers everything that shouldn't be transparent.
     
  3. KRWatkins

    KRWatkins

    Joined:
    Jun 25, 2019
    Posts:
    6
    Hard to tell for me, it appears to but when I open it up in paint it has a white background. Could someone double check to see if I'm having a moment? MetalWAlkway_color.png is the one I edited in Gimp and the other one is the obvious substance designer one. They both seem to give me the same undesirable results in Unity. Really want to know what I'm doing wrong and stop wasting time on this simple stuff. This
    is the only video I found on the tube showing how to make an alpha channel in Gimp that I could find. Probably doing it wrong in Designer too. Man I miss having photoshop, everything is just so expensive now.
     

    Attached Files:

    Last edited: Oct 25, 2023
  4. KRWatkins

    KRWatkins

    Joined:
    Jun 25, 2019
    Posts:
    6
    I kind of got it when I set the material Rendering Mode to Fade. I downloaded a similar material and the only difference I could find was it used the cutout instead of transparency and the texture didn't have 'Use Alpha as Transparency' checked. When I open it up in GIMP I can confirm the alpha channel is present. After a lot of doing the same steps over again I got some results.

    here's what happened -
    When I applied this texture to a material and set it to transparent all the areas that should be transparent are solid black. Then I tried to use Cutout and the whole texture would vanish altogether at a certain scale on the slider. Then I tried to use Fade and viola, it worked. Switching it back to cutout worked too. I'm sure I've just been messing up the alpha channel over and over again without realizing.

    I checked out the documentation again to read about the differences. Should have a better understanding going forward. Just got frustrated and couldn't figure it out for far too long.