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

Bug ScreenSpaceAmbientOcclusion set as disabled at runtime makes the scenes darker

Discussion in 'Universal Render Pipeline' started by vagelis199, Aug 26, 2023.

  1. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    167
    Hi!, In the game I'm building for Android I have a toggle for ScreenSpaceAmbientOcclusion in graphic settings.
    when I turn the toggle off my scene looks darker and when it's on, it looks normal. this only happens in runtime, at the editor the Ambient Occlusion just turns on and off as intended. Why does this happen? and what can I do to fix it? The only thing that came into my mind, is to bump up the brightness in the Post Processing profile, when the AO is disabled.

    Unity Version 2021.3.18f1 using URP

    Here is how I toggle the AO:
    Code (CSharp):
    1. renderer.rendererFeatures[0].SetActive(true);
    2.  
    Here is how it looks on the editor:

    Here is how it looks at runtime (Android):


    Edit: Posted a better example picture.
     
    Last edited: Aug 26, 2023
  2. vagelis199

    vagelis199

    Joined:
    Jul 27, 2012
    Posts:
    167
    I completely removed the ScreenSpaceAmbientOcclusion from the URP asset "Renderer Features" section and the brightness is back to normal, so I assume its a bug?
     
  3. michelecipriani80

    michelecipriani80

    Joined:
    May 21, 2021
    Posts:
    8
    This also happens with Unity 2022.3.6f1, the solution is changing the Quality Settings at runtime, not the AmbientOcclusion, and each Quality Settings URP asset has its own AmbientOcclusion settings.