Search Unity

Question Screen Space Reflection for transparent materials

Discussion in 'High Definition Render Pipeline' started by ktitov-nekki, Sep 16, 2020.

  1. ktitov-nekki

    ktitov-nekki

    Joined:
    Sep 16, 2020
    Posts:
    4
    Hi! I tried to understand how this features works but cannot find any documentation about it.

    I setup a simple scene in Unity 2020.b2 and HDRP v10-preview.27
    upload_2020-9-16_18-43-49.png

    You can see SSR on flat reflected opaque surface but no ssr on transparent material.

    As I understand to enable it you need to do it on HDRP Asset and on specific material. After that I see something on transparent object but it looks like reflection from opaque object going through transparent.

    upload_2020-9-16_18-46-3.png

    Am I doing something wrong or it does not work?
     
    Camarent likes this.
  2. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    +1

    HDRP settings:
    upload_2020-10-10_18-2-48.png

    "Transparent Screen Space Reflection" is ON, but transparent Lit material reflections not working, if changed to opaque yes.
    Unity 2020.0b6.3259, HDRP 10.0.0-preview.27

    upload_2020-10-10_20-36-54.png
     
    Last edited: Oct 10, 2020
    Camarent likes this.
  3. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
    You can see strange effect of SSR Transparent if you place some opaque object right behind transparent object:)
     
  4. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    No, opaque object behind transparent object- reflections O.K., but glossy transparent object (right) N.O.K.
    I forget to write one thing: I am using raytraced (dxr/rtx) SSR- without raytracing SSR not working at all...

    upload_2020-10-12_11-46-47.png
     
    Last edited: Oct 12, 2020
  5. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    This is from Unity manual, what is new in hdrp 10:
    "Screen-space reflection on transparent Materials
    HDRP's screen-space reflection (SSR) solution now support transparent materials. This is useful for transparent surfaces such as windows or water."

    My English is bad - did I understand that transparent objects (such as windows) will reflect the surroundings (such as (opaque) mirrors)?

    Or is it that opaque objects behind transparent objects will now reflecting correctly? And if I want to mirror the surroundings in transparent object, do I still have to use a reflection probe?
     
    Last edited: Oct 12, 2020
  6. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Transparency reflections (both screen space and ray-traced) are working in latest 10.1 HDRP package (from GitHub with manual installation. Better start project from scratch too or it can be messy - random features will not work properly; but anyway project won't work after successful build (black screen))...
    Buildmark v2020.1[Editor]12-10-2020 13.jpg Buildmark v2020.1[Editor]12-10-2020 14.jpg
     
    Last edited: Oct 12, 2020
    Camarent and fuzzy3d like this.
  7. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
    Are that screenshots with raytracing enabled?
     
  8. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Yep.
     
  9. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
    I hoped that Unity fixed general SSR because right now it's pretty bad without raytracing.
     
  10. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Nope, it's still glitchy and can't work with smoothness below 0.9 but at least they're working on transparent objects (and reflecting ray-traced GI and other effects, when ray-traced reflections are not doing that).
     
  11. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
    What do you mean by "can't work with smoothness below 0.9"? They have "minimum smoothness" in SSR settings which change what pixels will receive SSR by their smoothness.
     
  12. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    SSR not blurring reflections *yet* - so, no matter how smooth or rough material surface is SSR reflections on it's surface will be always sharp like it's polished ...
     
    Camarent likes this.
  13. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
  14. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    olavrv, valarnur and fuzzy3d like this.
  15. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    upload_2020-10-28_12-5-0.png upload_2020-10-28_12-2-15.png
    2020.2.0b8 + HDRP Version 10.1.0 - October 20, 2020 installed, no rayraced reflections in transparent material. If I turn material from transparency to opaque then yes (HDRP/Lit, material Receive SSR Transparency is ON).
    upload_2020-10-28_12-2-15.png
    Edit: Transparent reflection starts working with Path Tracing, but this is unusable for realtime (on my hardware).
    upload_2020-10-28_12-5-0.png
     
    Last edited: Oct 28, 2020
  16. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Hey, @fuzzy3d ,
    Ray Traced Reflections are working on Transparent objects.
    You need to enable them at 3 places to make them work :
    • On your HDRP Asset, your need to have Screen Space Reflection and Transparent ON
    • On your HDRP Default Settings, your need to have Screen Space Reflection and Transparent ON (I'm guessing this is the one you're missing)
    • On your transparent material you need to have Receive SSR Transparent ON
     
    oleg_v likes this.
  17. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    HDRP settings come up really often on Unity Discord as well. There doesn't go a single week by without someone struggling with the initial setup to enable feat x.

    I'd suggest Unity to put some warning in the components themselves if the feature hasn't been enabled on either hdrp asset or in current frame settings, just to make sure users understand immediately which part is missing. There's similar check on HDRP Wizards DXR section right now but users would expect to see a note on the the volume itself - telling what is missing.
     
  18. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    I don't think we want to put a note on the volume for that because the fact that a transparent receives SSR is managed on the material side of that transparent, we can't loop over all object to check if there's any transparent that want to receive SSR or risk the fact to have a warning always there if the user don't want to enable the fact that Transparent can receive SSR.

    But, I agree this is a difficult subject and some efforts have been made to made it clearer.
    For example, there's an improved DXR Wizard that's coming that is addressing some of the issue you are talking about.

    upload_2020-10-28_15-23-30.png
     
  19. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    I think I know about all the conditions mentioned, but it still doesn't work.

    New Project created (2020.2.0b8 + HDRP 10.1.0):

    upload_2020-10-28_16-22-53.png


    Pipeline Wizard- Reflections and Transparent Reflections ON:
    upload_2020-10-28_16-10-23.png

    All files with HDRP settings- SSR ON, Transparent SSR ON:
    upload_2020-10-28_16-25-13.png

    Opaque aterial created, Receive SSR ON:
    upload_2020-10-28_16-28-15.png

    Material duplicated, set to Transparent, Receive SSR Transparency is ON:
    upload_2020-10-28_16-29-32.png

    Final result- opaque material reflections O.K., transparent material N.O.K.

    So, please, see where I'm making a mistake?
     
  20. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    Result:
    upload_2020-10-28_16-40-21.png

    Both materials opaque:
    upload_2020-10-28_16-44-25.png
     
  21. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    You forgot the HDRP Default Settings
    upload_2020-10-28_16-41-57.png

    The idea behind this one is that theses settings are the default frame settings for all the cameras in your scene, so enabling it here will allow your camera to display SSR on transparent.
    Also, the custom frame settings on the camera will allow you to fine tune this across the cameras in your scene, you could have a camera with SSR Transparent enabled and one that don't have this option for example.
     
    fuzzy3d likes this.
  22. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    Finally!!!

    upload_2020-10-28_16-47-42.png

    Thank you, I understand that making the settings so that they are as flexible as possible and meet all possible requirements is difficult, so the result is a very complicated setting, but sometimes I go crazy about it.
    Thanks again.
     
    chap-unity likes this.
  23. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    Info: If you are migrating from HDRP 10.0 to 10.1 and have problems with existing transparent materials (or the build crashes) then try HD Render Pipeline Wizard-> Upgrade HDRP Materials to Latest Version. It helped me.
     
  24. SDTF

    SDTF

    Joined:
    Sep 3, 2020
    Posts:
    9
    this is still not working for me. I've done everything in the suggestions on this forum
     
  25. SDTF

    SDTF

    Joined:
    Sep 3, 2020
    Posts:
    9
    only on certain materials tho, quite perplexing.
     
    mrrusby likes this.
  26. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    ´
    for HDRP 12 no "HDRP Default Settings". This time "HDRP Global Settings":
    upload_2021-9-10_19-17-5.png

    this is not in "Realtime Reflection" section!?!! but "Lighting"
    works fine
     
  27. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Maybe we can improve the naming because it can be confusing but "Realtime Reflection" here means "The Default Frame Settings for Real Time Planar Reflection Probes and Real Time Reflection Probe" and the one below (Baked or Custom..) is for Baked or Custom Reflection probes...

    Each different sections (camera, planar and real time reflection probes, baked or custom reflections probes) can have different default frame settings that way.
     
    Last edited: Sep 13, 2021
    fuzzy3d likes this.
  28. mrrusby

    mrrusby

    Joined:
    Aug 25, 2021
    Posts:
    7
    Its a bit of a mess to have have so many steps to enable an important feature. a big red 'enable reflections' eveywhere
    button would be nice
     
  29. olracrafter

    olracrafter

    Joined:
    May 7, 2021
    Posts:
    2
    Hi, i was messing around with hdrp graphic settings (i have hdrp 12.1.0) and to solve this issue i found this forum, but there is a problem i can't solve. I followed all the instructions above and now transparent objects can reflect other objects but transparent objects don't appear in reflections with theese tecniques: ray marching, raytracing and mixed (i am using mixed in this case) as you can see below. Of course path tracing can cast transparent objects but it's too ugly. ReflectionIssue.png
    That's also quite strange because i searched all the options related to the transparent objects both in project settings and material settings.
     
  30. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Hey, nothing wrong on your side. It's totally expected.
    The things behind "Transparent SSR" in HDRP is only for transparents objects to be able receive SSR but we just can't reflect transparent objects in Screen Space Reflection because SSR uses color pyramid and depth buffer and those don't includes transparents since they are rendered later in the process.
     
  31. olracrafter

    olracrafter

    Joined:
    May 7, 2021
    Posts:
    2
    So I can fix this just by changing the rendering order, can I?
     
  32. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    No; Your object have to be opaque. You can use alpha clipping or even dithering to have some sort of "fake transparency" but you won't be able to see a transparent in screen space reflections.
     
    Orange_Fella and hugokostic like this.
  33. AustinMclEctro

    AustinMclEctro

    Joined:
    May 3, 2017
    Posts:
    16
    Oh my goodness. I just spent a few hours wondering why I couldn't get Transparent SSR working, and finally I found it with your help @chap-unity :

    upload_2021-12-9_18-31-13.png

    So to summarize, for Transparent screen space reflections to work, it has to be enabled it in the following places:
    • Need Project Settings / HDRP Default Settings / Lighting / Screen Space Reflection enabled and the Transparents sub box enabled (shown in above image)
    • ALSO need your Project Settings / Quality / HDRP / Lighting / Reflections / Screen Space Reflection and the Transparent sub box there enabled
    • Need to have a SSR override on a volume in your scene (such as a global volume)
    • Material (custom or otherwise) should have the Receive SSR Transparent box enabled, assuming it is a Transparent surface type
     
    Genebris, jjbish, aekdragon and 2 others like this.
  34. boysenberry

    boysenberry

    Joined:
    Jul 28, 2014
    Posts:
    365
    I spent hours trying to figure out how to get the Screen Space reflection and Transparents boxes from being grayed out. This helped me a lot. I didn't see the settings in the Project Settings / Quality / HDRP / Lighting / Reflections / Screen Space Reflection area until I saw this, thank you!
     
    AustinMclEctro likes this.
  35. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    So transparent objects don´t appear in raytraced reflections - is this still the case in current hdrp version?
    If yes, are there any plans to fix this?
     
    Last edited: Jul 26, 2022
  36. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Sadly, yes.

    For now, no. It's a matter of order in the pipeline itself and there's no plans of shuffling everything "just" for this.
     
    Orange_Fella likes this.
  37. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Thanks for your honest reply
     
    chap-unity likes this.