Search Unity

Baking meshes with Alpha Cut Material

Discussion in 'Global Illumination' started by eduroam, Mar 15, 2021.

  1. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    48
    Hi guys.

    I have an issue baking meshes with alpha cut material. If I use a custom material using shader graph with alpha cut the baking doesn't take into account the alpha (left image), but if I use a Unity Lit shader without configuring any extra step only activate the alpha clipping, everything looks fine.

    Do I miss something in my custom shader in the shader graph?

    Using Unity 2019.3.15f HDRP 7.4.1

    Thx for any help
    Eduardo
     

    Attached Files:

  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    We had a somewhat related issue in URP which has been fixed since 2019.4 LTS. Could you try upgrading to the latest 2019.4 LTS? If the issue persists, please submit a bug. Thanks.
     
  3. DominoOne

    DominoOne

    Joined:
    Apr 22, 2010
    Posts:
    433
    Hi! I have the same issue for the Standard Rendering Pipeline. Tried with Unity 2020.1 and 2020.2. Standard shader respects alpha, where it's being cut-off, but with a custom surface shader it doesn't respect it anymore in baked shadows (image attached). Is there anything I could do to fix or work around this?
     

    Attached Files:

  4. DominoOne

    DominoOne

    Joined:
    Apr 22, 2010
    Posts:
    433
    OK, so after reading the bug linked above again, I tried changing the main texture variable to _MainTex, and it worked. Now it respects transparency. So, I suppose Unity just has to fix the same thing for SRP as they did for URP (just different main texture variable name there).
     
    kristijonas_unity likes this.