Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question incorrect display of transparent material

Discussion in 'Universal Render Pipeline' started by Zimaell, Aug 9, 2023.

  1. Zimaell

    Zimaell

    Joined:
    May 7, 2020
    Posts:
    337
    I needed to apply an alpha mask to my object, everything looks as intended in the Blender, but when I exported it to the Unity, problems started there.
    1. After switching to transparency, some kind of texture becomes partially transparent or how to describe it, in general, in the attached files you can see how it looks.
    2. Secondly, after turning on Alpha Clipping, adjustment Threshold does not work (none change), most likely due to a faulty first item.

    Using the latest version of Unity,URP, standard Lit shader.

    I want to note that in the unit such an image is distorted and without a mask, that is, if you simply set the initial material to transparent, then it will be with the same artifacts.
    The texture of the head itself is in JPEG format, but I even tried to convert it to PNG and this did not bring any result.

    What could be the problem?
     

    Attached Files:

    Last edited: Aug 9, 2023
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    625
    Hi, that's because the depth write (and depth test) of URP Lit shader are disabled if the surface type is set to transparent.

    It's hard to have fast and accurate sorting for semi-transparent objects, so I suggest using Alpha Clipping (alpha 0 or 1) for transparency and keep the surface type opaque.

    You need to put the alpha mask texture into the alpha channel of base color texture. This can be done in software like photoshop or gimp.
     
  3. Zimaell

    Zimaell

    Joined:
    May 7, 2020
    Posts:
    337
    I need to turn off different parts of the texture so that they do not crawl through the clothes, so I not only need this mask, but even more masks, so I need the transparency to be properly maintained....
    so the problem needs to be solved with transparency without changing the texture...