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

Other Turning on ambient occlusion makes every object black

Discussion in 'Editor & General Support' started by NormyHaddad, Jul 28, 2023.

  1. NormyHaddad

    NormyHaddad

    Joined:
    Jan 10, 2022
    Posts:
    13
    I'm trying to add ambient occlusion to my game so the lighting looks more realistic, but when I do it turns everything except the terrain really dark when lit by the main directional light. Using other lights does light up the scene properly. I don't know what's causing this, anyone have any ideas?

    Lighting settings:
    upload_2023-7-28_17-28-52.png

    Without AO:
    upload_2023-7-28_17-21-54.png

    With AO (no flashlight):
    upload_2023-7-28_17-30-13.png

    With AO (flashlight):
    upload_2023-7-28_17-30-33.png
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    Directional lights default to realtime lighting only, so will not provide baked lighting. Check that it is set to baked or mixed.

    There is also realtime SSAO available either in the renderer settings or postprocessing stack (global volume), depending on render pipeline.

    Btw Enlighten is deprecated now, you seem to be using an older Unity version. Try the progressive lightmapper, especially if you don't want your re-tweak your lighting if you upgrade Unity at some point.
     
  3. NormyHaddad

    NormyHaddad

    Joined:
    Jan 10, 2022
    Posts:
    13
    The directional light is already set to baked, and I've switched to progressive CPU. Still the same problem as before
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    What about the Lighting Settings? Is there something in those settings that may affect AO?
    You could also try changing that bottom setting Lightmap Parameters to something other than Default-Medium.

    I can certainly make my scene black by tuning the SSAO settings (realtime, not baked AO - but technically the same thing) so I kind of suspect that some setting simply causes the AO to be cranked up to maximum. The 3 settings in the screenshot seem alright, and specifically max distance is reasonably low. To make my scene black I'd have to have distance way over 10 or more.