Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Transparent behind transparent doesn't display, 2019.3.2f1

Discussion in 'High Definition Render Pipeline' started by dragon_slumber, Mar 4, 2020.

  1. dragon_slumber

    dragon_slumber

    Joined:
    Jun 11, 2017
    Posts:
    30
    Hey everyone,

    I'm trying to display a transparent material behind another transparent material and it doesn't seem to be working, the object behind doesn't appear although opaque materials work fine. I'm talking a glass behind a glass, or even a particle effect behind a window. Playing around with the parameters, I've gotten the element behind to display on top by changing the sorting, but that's not really a viable solution. I'm running Unity 2019.3.2f1, is there any solution to this?

    Thanks!
     
  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    When you mention "glass" is the issue you're having like this ?
    upload_2020-3-5_11-12-9.png

    This is expected as it's how the refraction system is implemented : for rendering refraction we're using the color buffer of what was rendered before the transparent object, as an effect, no regular transparent objects are visible in the refraction.

    You can however specify on your material that you want it te be rendered "before refraction":
    upload_2020-3-5_11-15-17.png
    In that case, if the object is placed behind an object with refraction, it will be visible through it :
    upload_2020-3-5_11-15-51.png
    But the pre-refraction object will not be able to do refraction itself.

    In the case none of them is using refraction, they should render properly like this :
    upload_2020-3-5_11-17-35.png
     
  3. dragon_slumber

    dragon_slumber

    Joined:
    Jun 11, 2017
    Posts:
    30
    Thank you for this, but I don't seem to have a "Before Refraction" Rendering pass option (only Low Resolution), nor do I have a "Blending Mode" option. It directly skips to Sorting Priority. This is a HDRP/Lit material with HDRP version 7.1.8.

    upload_2020-3-6_10-50-53.png
     
  4. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    Sorry, I forgot to mention that you need to disable the refraction settings on the material to have all the options in the rendering pass dropdown. A materials can't at the same time use refraction and be in the pre-refraction pass.
     
    dragon_slumber likes this.
  5. dragon_slumber

    dragon_slumber

    Joined:
    Jun 11, 2017
    Posts:
    30
    Sounds great, I'll play around with these options, thank you for your help!