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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How do you bake ambient occlusion?

Discussion in 'Global Illumination' started by knas01, Jul 24, 2019.

  1. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    233
    I'm trying to bake AO into my scene, but I can't get it to work. Under the lightmapping settings I check the AO button but no matter what settings I use nothing happens when I generate lighting. Well, stuff happens, but there are no AO shadows rendered.
    I can get AO to work if I add it as a filter to a camera, but I want to bake it and I don't think you can do that with a camera filter.
    The scene has no lights and is lit by ambient light. The mesh is made with ProBuilder and I'm using U5.6.
    What can I do to get this to work?
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Checking Ambient Occlusion flag in the lighting settings should work. Could you try baking your scene using Unity primitives, or other meshes and see if the issue reproduces?
     
  3. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    233
    I thought so too, but it does nothing. I tried adding some basic cubes but they get no AO either.
     
  4. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    233
    Yea I still can't get the built in AO to work. Could use some pointers here.
     
  5. JenniferNordwall

    JenniferNordwall

    Unity Technologies

    Joined:
    Sep 19, 2016
    Posts:
    160
    Could you post your settings for the scene and also a screenshot or something? Just more info would help :)

    Cheers!
     
  6. knas01

    knas01

    Joined:
    Feb 24, 2018
    Posts:
    233
    I was about to post some settings but I managed to figure out why it didn't work. In addition to AO and other light settings you also had to set ambient mode to baked or nothing happens when you make a light map.
     
  7. JenniferNordwall

    JenniferNordwall

    Unity Technologies

    Joined:
    Sep 19, 2016
    Posts:
    160
    This is a really good point, and something we probably should make a warning about. Thank you for pointing this out :)
     
  8. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,878
    What does this mean? "ambient mode" of what?
     
    ethanicus and belahrem like this.
  9. rmichels

    rmichels

    Joined:
    May 26, 2021
    Posts:
    2
    Not 100% sure, but I think this is referring to the "Mode" dropdown on the Directional Lights in your scene. That, and making sure that the items in the scene had their "Static" toggle checked (next to the GameObject name in the inspector) is what finally got me results.
     
    a436t4ataf likes this.