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

URP Transparency Issue

Discussion in 'Universal Render Pipeline' started by cassius, Jun 15, 2020.

  1. cassius

    cassius

    Joined:
    Aug 5, 2012
    Posts:
    124
    I have an issue with my transparencies when using URP's Unlit shader. When an object has a transparency, it seems the back of the object is rendered rather than the front of it. In other words transparent objects farther show "through" transparent objects that are closer.

    A video to show what I mean. Notice that the plants farther away are visible while plants that should be in front of them are not.



    I'm sure I must be missing something simple here. Does anyone know what's up?
     
  2. Nzollner_Unity

    Nzollner_Unity

    Unity Technologies

    Joined:
    Apr 20, 2020
    Posts:
    5
    Hi cassius, This is a bug and I have created a bug report for you. I will report back as soon as the bug has been resolved.

    EDIT: This isn't a bug. If pixels below a threshold of its alpha value should be discarded and not used for alpha blending. Then the object should be set to opaque with alpha clipping enabled.
     
    Last edited: Jun 17, 2020
  3. cassius

    cassius

    Joined:
    Aug 5, 2012
    Posts:
    124
    Thanks @Nzollner_Unity

    I should mention that in my video the plants are all a single mesh. Not sure if that makes any difference. And also I tried most of the URP Shaders and they all have the same issue. It seems strange that the URP shaders I tried had the same issue and that it hasn't been reported/bug report before now. I had the same problem with all the 2019.3 releases as well.
     
  4. Nzollner_Unity

    Nzollner_Unity

    Unity Technologies

    Joined:
    Apr 20, 2020
    Posts:
    5
    Hi again
    To enable depth test and discard the pixels below a given threshold try changing the object to opaque and enable alpha clipping. I hope this will resolve your issue.
     
    shmatok27 likes this.
  5. cassius

    cassius

    Joined:
    Aug 5, 2012
    Posts:
    124
    Hi,

    This lead to some rough edges but it did work!

    For anyone else that reads this thread later... Additionally, since I'm using a PSD file, I selected both "Alpha is Transparency" and "Remove Matte (PSD)" within the Inspector for the Base Map texture image being used for the material. In Photoshop, I duplicated my layers and flattened them into a new single layer, did a Gaussian Blur of about 2px and dropped the new layer to the bottom. Looks great now!

    Thanks for the help!
     
    nurlynnda and AshwinTheGammer like this.
  6. cb_short223

    cb_short223

    Joined:
    Mar 29, 2018
    Posts:
    3
    I have the same issue but the Opaque/Alpha Clip method is not the desired look I need. Attached are two examples, one with the material set to Opaque with the Alpha clip. It gives me a hard edge that is not what I need. The other image is the same material but set to transparent and gives me the exact look I desire, but it creates that problem with other transparent object in front of it as has been mentioned. The transparency works in the standard mode using the Fade option (not Universal Render Pipeline). Is there any solution to this? Alpha_Clip_Not_Good.png Transparency_What_I_Need.png
     
  7. eliteforcevn

    eliteforcevn

    Joined:
    Oct 25, 2018
    Posts:
    47
    same issue in 2022 :)))
     
  8. LT23Live

    LT23Live

    Joined:
    Jul 8, 2014
    Posts:
    79
    @Nzollner_Unity Having this issue with 2021.3.1. Alpha clipping isn't what I want. I want to actually be able to drive the opacity of an object from 0 to 1 and back again. What can I do?
     
    AnahidE5, edsludden and owen_proto like this.
  9. owen_proto

    owen_proto

    Joined:
    Mar 18, 2018
    Posts:
    118
    @Nzollner_Unity Same question here!
     
    AnahidE5 and edsludden like this.
  10. AnahidE5

    AnahidE5

    Joined:
    Jan 10, 2022
    Posts:
    40
    I also have the same problem and don't know how to fix it, Unity 2021.3.5.
     
  11. eliteforcevn

    eliteforcevn

    Joined:
    Oct 25, 2018
    Posts:
    47
    they dont care about this :D