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

Resolved Transparent surfaces not receiving SSR despite all settings enabled

Discussion in 'High Definition Render Pipeline' started by mgeorgedeveloper, Aug 9, 2023.

  1. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    242
    Unity 2022.3.2 - I noticed that our water surfaces no longer show SSR.
    I double checked the asset and the frame settings to ensure transparent SSR is enabled.
    The only way I can get SSR to show up, is to make the water surface opaque.

    Is this a known issue or should I file an official bug report?

    ssr-problem-1.png

    ssr-problem-2.png

    ssr-problem-3.png

    ssr-problem-4.png

    ssr-problem-5.png
     
    Last edited: Aug 9, 2023
  2. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    242
    Resolved - you have to explicitly enable Transparent Prepass in the frame settings.

    ssr-fixed.png
     
    chap-unity likes this.
  3. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    499
    I have followed the settings above but have this issue. It seems like you cant render a transparency behind the material when it receives SSR? Any ideas what is causing this. Unity version 2023.1.12f1.

    upload_2023-9-13_20-9-5.png
     
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    692
    It's not about SSR, it's just that you can't stack multiple réfractive transparent in HDRP.

    Thé only way to see your Pool behind your glass pane would be to set it's rendering queue to "Before Réfraction" instead of "Default"
     
  5. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    242
    So we have refracted water and over the water we can have refracted glass windows through which you can see the water (including the surface below the water)

    Both the water and the glass are transparent surfaces, but mostly operate with alpha 1, and reading from HD Scene Color to do custom refraction.

    Now I'm pretty sure in a past, a few versions back for HDRP, I had this magically working by doing either the glass or the water in a custom pass (can't remember), with a lucky update of the color pyramid somehow between the two. So that meant that when drawing the glass, the HD Scene Color node was actually including the water. I can't quite remember how this worked, but it doesn't matter much because it doesn't work anymore.

    Instead, I am now doing to following:

    1. Render the water during the default transparent pass. This should work with Refraction or simply doing your own reading of HD Scene Color in a distorted manner.

    2. Render your glass using Distortion - this will use the updated "Distortion Color Pyramid" which is updated AFTER the water was rendered.

    3. Now this leaves a problem - your glass surface details with suffer from the Distortion Blur (if you are using blur), instead of being preserved. For example specular highlights off small surface details will be killed. This last part can be solved by rendering your glass surface detail in a custom pass injected at "Before Post Process", which is just after the Distortion rendering. You can set your alpha to 0, and "preserve specular lighting" to 1. Now you can render your specular glass surface detail over everything else.

    SIDE NOTE: I wanted to avoid the built-in Distortion due to the blurring issue, and instead wanted to simply render the glass entirely in Before Post Process, including the distorted and blurred scene color (via HD Scene Color) and the preserved surface detail.... however: HD Scene Color does not read from the updated Distortion Color Pyramid - it seems to be stuck with the old color pyramid that was originally created at some point earlier.... so this is a fail, since your water will now be excluded from your scene samples.
     
    Last edited: Sep 14, 2023
  6. mgeorgedeveloper

    mgeorgedeveloper

    Joined:
    Jul 10, 2012
    Posts:
    242