Search Unity

What's the correct way to use Baked AO + Material AO + SSAO ?

Discussion in 'General Graphics' started by Arnklit, Dec 14, 2018.

  1. Arnklit

    Arnklit

    Joined:
    May 18, 2015
    Posts:
    48
    If I have a game with some baked lighting I can choose to bake AO into that as well and if I'm using PBR materials I can also add AO maps there, I can then additionally add screenspace AO post processing.

    I would assume you are not supposed to use all these together because you'll be getting a doubling up effect, but obviously SSAO will be adding a realtime effect that neither the baked or the maps can accomplish.

    Does anyone have any tips on what is best practices with this if you are aiming for realism?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    If you are aiming for realism, don’t use any AO at all :) (you’d have to find some technique for indirect shadows for your main characters, like in the Last of Us).

    The only AO I would use would be material AO, since that is used to eliminate reflections in areas where it would be hard to reflect anything.
     
  3. Arnklit

    Arnklit

    Joined:
    May 18, 2015
    Posts:
    48
    Ehh, why would you not use it at all? I know Ambient Occlusion is an approximation, but isn't it still more realistic than nothing?
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    It’s not an approximation it’s flat out unrealistic.
     
  5. Arnklit

    Arnklit

    Joined:
    May 18, 2015
    Posts:
    48
    I'm sorry, I still don't understand what you mean. As I understand it AO is an approximation of where less light can reach and it's used because it's not possible to do real GI. Without it we wouldn't be getting any occlusion in non direct lit scenes.
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,723
    “Occlusion” does not happen in real life. The corners in your room do not darken as they do with AO.

    If you want realism, use GI light mapping a lot (without AO), maybe some short distance AO on the materials and find something to use for indirect shadows for your characters.

    I’ll try to explain myself more when I find myself behind a keyboard.
     
    thefirstplaybae likes this.
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,339
    The conceit that ambient occlusion goes by is that all ambient lighting comes from a perfect sphere of light homogeneous white light around the object. Also, that all objects are perfectly diffuse white surfaces. In that regard ambient occlusion does a far job at approximating the real world ...

    But nothing in the real world is ever lit by a perfect sphere of white light, except for under laboratory conditions or Stanley Kubrick films. Thus this approximation breaks down really quickly. And in general the real shadowing of ambient light is much more subtle than the usual AO you'll see used in games. It's use is much more of a stylistic choice than anything related to making things realistic.

    Most of the time GI alone will do a good job of replicating a more realistic ambient light shadowing, so no AO is needed, though it's also only going to work well on larger scale objects unless you crank up the lightmap resolution. Material AO helps fill in the gaps there for the finer details, though you generally want to keep the AO radius you're using to be quite small, or use bent normals which do a much better job of approximating the directionality of ambient shadowing. Post process SSAO fills in the gaps between the small and large scales of baked GI and material AO, and can help with objects that are animated, but it's always a bit heavy handed. As @AcidArrow alluded to, many games go a complete different approach with post process / dynamic AO and use something like simplified shapes or distance fields to limit the effect to the areas they want rather than the entire view. In many cases this also allows for much more accurate and directional ambient shadowing that takes into account the fact ambient lighting is not a homogeneous sphere of light.
     
    SgerbwdGwyn and AcidArrow like this.
  8. Arnklit

    Arnklit

    Joined:
    May 18, 2015
    Posts:
    48
    Thanks bgolus, that definitely helped me understand it better.