Search Unity

Bug Realtime shadows only work when SSAO is enabled

Discussion in 'Universal Render Pipeline' started by evstinik95, Dec 23, 2022.

  1. evstinik95

    evstinik95

    Joined:
    Jun 28, 2017
    Posts:
    7
    Hi! I'm experiencing strange behaviour with Oculus Quest 2 and Unity 2021.3.6f1, URP 12.1.7.

    I have a small scene which uses 1 realtime directional light. I want to disable AO, but keep the shadows from that light. I see shadow in the editor and in play mode (quality settings the same - Balanced) all the time (whether or not SSAO is enabled). But when I build and run it on Oculus Quest 2 there are no shadows if SSAO is disabled.

    I'm probably missing some other settings, but not aware of any relevance of how SSAO can affect shadows.

    Does anyone have a tip for me? Any other important information I did not mention?

    Thanks.


    Screenshot 2022-12-23 at 8.56.55.png
    f01d3f4074a740509f097d2222ff56af.jpg
     
    AliBuck likes this.
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Update unity
    Make sure realtime shadows are enabled
    Try a blank project
     
    Last edited: Dec 23, 2022
  3. evstinik95

    evstinik95

    Joined:
    Jun 28, 2017
    Posts:
    7
    Updated to 2021.3.16f1. Tried a blank project. Still same problem. As soon as I disable SSAO shadows also disappear.

    > Make sure realtime shadows are enabled

    How to make sure realtime shadows are enabled? Well I did not find exactly checkbox "realtime shadows" :D I think I looked everywhere in project settings and in rendering pipeline asset - everything containing word "shadows" looks enabled, made sure my light is realtime.
     
  4. Sky77

    Sky77

    Joined:
    Jan 30, 2014
    Posts:
    171
    Are you using different URP profiles? Make sure shadow are enabled in the URP profile you use in Quest.
     
    DevDunk likes this.
  5. GpuGem

    GpuGem

    Joined:
    Feb 24, 2022
    Posts:
    6
    evstinik - I'm seeing the same issue. very strange. did you figure it out?
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    If you have this issue I suggest making a bug report
     
  7. evstinik95

    evstinik95

    Joined:
    Jun 28, 2017
    Posts:
    7
    Unfortunately no, but I have discovered that it's not really Quest-related. It's more of differences in behaviour between play mode and build. I have tried to make a Desktop build and have the same results - standard balanced URP profile with disabled SSAO has missing shadows.
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Did you make a bug report?
     
  9. evstinik95

    evstinik95

    Joined:
    Jun 28, 2017
    Posts:
    7
    No, I have not, I still believe there is an error somewhere between monitor and chair :)
     
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    What?
     
  11. evstinik95

    evstinik95

    Joined:
    Jun 28, 2017
    Posts:
    7
    I think that problem is me: I don’t do something right or have messed up some configuration.
     
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    If you tried it in a blank project and just disable the ssao (maybe make a video recording of it), it sounds like a bug. You could also loop up some kind of sample project so you can test it on your device
     
  13. AliBuck

    AliBuck

    Joined:
    Aug 22, 2020
    Posts:
    30
    Same problem for Android. Can't seem to find a workaround... SSAO really slows my game down...
     
  14. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Make a bug report in a small repro project
     
  15. AetherMFP

    AetherMFP

    Joined:
    Feb 11, 2022
    Posts:
    39
    can confirm this issue still exist after 2022.2.5
     
  16. BehX

    BehX

    Joined:
    Mar 7, 2017
    Posts:
    1
    For anyone facing the same issue , simply remove the SSAO from the renderer or use the performant renderer as it doesn't have the SSAO by default.
     
  17. Elvar_Orn

    Elvar_Orn

    Unity Technologies

    Joined:
    Dec 9, 2019
    Posts:
    162
    Heyhey!
    This seems like a bug.
    I have one pretty similar to this one but that one doesn't make the Shadows disappear.
    I'm currently working on backporting the fix for that to 2022.2 and 2021.3.

    Can you send a bug about this one so I can verify that my fix also solves your issue?
     
    DevDunk likes this.
  18. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Does that also include the bug report I made about a shader not displaying when shadow cascades keyword is used but shadow cascades is disabled in the URP asset? (IN-30157)
     
  19. dtootill

    dtootill

    Joined:
    Oct 9, 2020
    Posts:
    29
    I'm experiencing this issue and posted bug report IN-42273 with a project that reproduces it - shadows in the editor, but no shadows in a build.

    I'm using Unity 2021.3.26f1 on Windows 10 with the built-in render platform and running the build on the same box used for development.
     
    Last edited: May 29, 2023
  20. Krynn_P

    Krynn_P

    Joined:
    Apr 24, 2023
    Posts:
    1
    same issue...
    2021.3.22f1 URP-Balanced android build
    try to change the shadowmask mode (Quality Setting).
    shadowmask > distance shadowmask
    upload_2023-5-31_17-6-47.png