Home Technical Talk

Are Ambient Occlusion Maps outdated?

I am confused as to why Ambient Occlusion maps are used in tandem with Normal Maps. A Normal Map is a dynamically shaded texture. Wouldn't an Ambient Occlusion overlay remove some of the dynamic shading that the Normal Map provides?

I have read the wiki portion on both Normal Maps and Ambient Occlusion maps and searched the forums.

Can someone explain to me the purpose of Ambient Occlusion Maps combined with Normal Maps?

Replies

  • Moosey_G
    AO maps are for shadows and lighting and Normal Maps are for retaining high poly quality onto to lower poly models.
  • kdm3d
    Aside from SSAO, there wont be much (if any) dynamic radiosity or bounced lighting to react with the normal maps. Therefore we have to bake the generic ambient radiosity and AO to look "lit" in a real time engine...
  • roosterMAP
    Offline / Send Message
    roosterMAP polycounter lvl 14
    AO maps are only for fasilitating the development of diffuse textures. I doubt there are any games that require AO maps because many of them generate it for the ingame geometry.

    Normal maps have nothing to do wth AO maps. They just store the shift of the normals on a surface. This is why normal maps cannot hold height data. In the end, the AO maps help the illusion of depth by being in the diffuse texture; Areas far away and in cracks become darker...

    also, there a difference between the AO maps used in texturing, and AO used in video games as an independent shader.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    Normal maps alter your surface normals based on a bitmap. When light calculates it compares your sampled normals direction with the incoming lights direction and shades accordingly. So since you have control of those normals with your normal map you can use this to fake the illusion of your surface being more detailed than it is when it comes to the lighting component.

    You're probably already familiar with this concept when it comes to your color map. You paint something in your texture which isn't "really there" model wise. Normal map is in a way the same thing but for the light component. It won't ever achieve the same results as a more detailed mesh would, but you can get very far with normal maps.


    Ambient Occlusion occludes ambient lighting (duh). In other words it tells the ambient lighting where it is allowed to end up on your model and where it's not allowed to end up. Ambient lighting is most commonly your "everyday" and usually subtle lighting. An ambient lighting can be anything from a uniform color to a HDRI probe. So to recap, the AO texture is like your mask for where this lighting will and won't end up on your model. The theory is that as light bounces around it won't end up as much in cracks and corners as on flat and open surfaces.
  • Eric Chadwick
    Yea, just look at the difference between a normal mapped model without AO and a normal mapped model with AO.

    One example.
    http://wiki.polycount.net/Ambient_Occlusion_Map#EQBM

    Another example.
    http://wiki.polycount.net/Diffusely_Convolved_Cube_Map#ECIP
  • PredatorGSR
    Offline / Send Message
    PredatorGSR polycounter lvl 14
    roosterMAP wrote: »
    AO maps are only for fasilitating the development of diffuse textures. I doubt there are any games that require AO maps because many of them generate it for the ingame geometry.

    There are a lot of engines that don't do AO on the fly, I would even say the majority of games don't have it. Even engines like unreal prebake the AO maps for most assets, which isn't any different in theory than baking them yourself, it just automates and streamlines the process.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    also, there a difference between the AO maps used in texturing, and AO used in video games as an independent shader

    heres your answer!

    Also, where light doesnt reach, is also where dust gathers. So yeah no matter how advanced your shader is, you need the AO pass in order to paint a convincing texture.
  • Anamnacha
    Thank you everyone!
    This is a lot of information and explains everything.

    You guys are awesome.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    There are a lot of engines that don't do AO on the fly, .

    Totally. plus you cant beat raytraced AO. the Zbuffer/Normal comparison tricks used in realtime never look as good as ray traced AO.
  • vargatom
    It's worth emphasizing that technically correct AO should only have an effect on ambient light, because direct light occlusion is what we also call shadows.

    So, theoretically, it is incorrect to bake full AO into the diffuse texture, it should be a dynamic component only. Of course this isn't realistic for games, but nevertheless, it should be used carefully and sparingly. Also, SSAO should only be composited into the indirect lighting pass during rendering; Uncharted 2 is a game I know to do it right.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    vargatom: While what you say is true about ambient occlusion (hence "ambient" in the name), while it may be "physically accurate" to only have it affecting the ambient light and not direct light, you might still want to use it just as a method for making your larger-scale shapes and details pop out a bit more, regardless of whether it's "realistic" or not.

    Obviously this depends hugely on art style, in some styles you might want to avoid AO at all purely for a specific look. And in ultra-real styles you would want to as vargatom said, and only use the AO as a map to occlude the ambient lighting, not the direct lighting.

    You'd still need it as Pior said though, since it is very useful for texturing (as AO usually indicates those "hard to reach" places in an object, where dirt/dust and other weathering will accumulate over time.
  • Eric Chadwick
    Right, but I think what vargatom is saying is that you generally don't want AO to prevent direct light from illuminating the surface. For example if a character lights a cigarette in the dark, the nostrils shouldn't remain black. When AO is simply multiplied into the colormap, this kind of lighting is impossible to achieve.
  • Daaark
    Offline / Send Message
    Daaark polycounter lvl 17
    When you bake an AO texture, you are baking it in the model's space, all around.

    When a game does AO in real time, it's called Screen Space Ambient Occlusion, and it's not the same effect. It operates as a post processing effect on the entire rendered image.
    Right, but I think what vargatom is saying is that you generally don't want AO to prevent direct light from illuminating the surface. For example if a character lights a cigarette in the dark, the nostrils shouldn't remain black. When AO is simply multiplied into the colormap, this kind of lighting is impossible to achieve.
    The thing with AO is that it has no basis in reality. It just darkens certain spots of a model, and makes it more eye pleasing. It has a nice way of really bringing out the details in a model, but it doesn't attempt to model the real properties of light.
  • EarthQuake
    Right, but I think what vargatom is saying is that you generally don't want AO to prevent direct light from illuminating the surface. For example if a character lights a cigarette in the dark, the nostrils shouldn't remain black. When AO is simply multiplied into the colormap, this kind of lighting is impossible to achieve.

    The small amount of times like this that it could be seen as a negative is still vastly outweighed by the majority of the time where you simply want to fake AO. As realtime rendering systems get more and more complex, i think we'll get to a point where we no longer need AO baked into textures, however we're pretty far off from that still I think.
  • IronHawk
    Offline / Send Message
    IronHawk polycounter lvl 10
    Style and consisteny should be the rule here IMO. Sometimes baking in gradients to ground objects or give them a better read is the rule.

    Is it realistic when hit with lighting? Not at all. However as a style I think it works well.

    Some people will bake gradients into a gun as well. EQ goes into more detail in one of his gun threads from a ways back.
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    Daaark wrote: »
    The thing with AO is that it has no basis in reality. It just darkens certain spots of a model, and makes it more eye pleasing. It has a nice way of really bringing out the details in a model, but it doesn't attempt to model the real properties of light.

    Sure it does?
    In reality light bounces around and looses a bit of it's intensity due to the length traveled but also times it has bouned and been partially absorbed by materials. These bounces will pretty much hit all over the place, but not as much in more occluded areas (cracks, folds, corners, etc). That's your basis right there. In real-time it's very performance heavy to do any ray tracing so we pre-calculate this in advance, hence the Ambient Occlusion texture.
  • ZacD
    Offline / Send Message
    ZacD ngon master
    ^That and AO also darkens areas that tend to gather dirt/grime.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Actually Daark is right. In offline rendering AO is classified as a non physically accurate effect. Its a measure of how occluded an area is, not a reaction to light. its pretty much a mask

    FG or Photon Mapping would be more physically accurate. They're much slower to solve though. usually you meet in the middle and solve a relatively rough FG/PM solution and use AO to compliment the effect(adding sharp contact shadows) AO can even transmit colour data in shaders such as Arch & Design

    using it 'correctly' is described very nicely by MasterZap (Mental Images Shader Author) on his blog
    http://mentalraytips.blogspot.com/search/label/ambient%20occlusion
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    r_fletch_r wrote: »
    Actually Daark is right. In offline rendering AO is classified as a non physically accurate effect. Its a measure of how occluded an area is, not a reaction to light. its pretty much a mask

    FG or Photon Mapping would be physically more accurate they are however slower to solve. usually you meet in the middle and solve a relatively rough FG/PM solution and use AO to compliment the effect.

    using it 'correctly' is described very nicely by MasterZap (Mental Images Shader Author) on his blog
    http://mentalraytips.blogspot.com/search/label/ambient%20occlusion

    Could you elaborate. I've read this article before and I read it again but I'm still not following how this is not based on facts from reality?
  • disanski
    Offline / Send Message
    disanski polycounter lvl 14
    I think when we bake AO maps there are no photons being calculated. It is more like calculating the distance between surfaces,( if they are closer they get darker) not the real light parameters. I am not 100 % sure about this - just how I understand it.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    It just darkens crevices. it doesnt account for the surface its occluding or the occluding surfaces.

    Rather than saying right i've hit a mirror which is reflecting a large amount of light back at me it says oh i hit a polygon Im now gonna get a little darker.

    Iits just a measure of how much potential occlusion could happen at a given point. It takes no notice of what its hitting. it only cares that its hit something
  • kodde
    Offline / Send Message
    kodde polycounter lvl 19
    Yeah I think I see what you are saying. But then again, they whole "ambient lighting" is quite far from reality as well if we want to elaborate on the subject.

    I think most people including me have gotten so used to CG being simplified solutions to fake reality and when you get something new that more closely resembles reality you are easily inclined to go "Ooo, that's so realistic". :)
  • ZacD
    Offline / Send Message
    ZacD ngon master
    disanski wrote: »
    I think when we bake AO maps there are no photons being calculated. It is more like calculating the distance between surfaces,( if they are closer they get darker) not the real light parameters. I am not 100 % sure about this - just how I understand it.


    Yeah it's not completely physically accurate to real lightning (is actually kinda backwards) but it emulates a real world effect.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    I personally cant wait till raytracing hits the realtime world at reasonable speeds. well be free of all this crap then.

    A while back i found an indie engine that raytracted Final gather and reflections in realtime. think it was called Aruna. cant find a trace (har har)of it on google.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    perna wrote: »
    Exactly what ZacD says, meaning that it has an absolute basis in reality.
    You can emulate "Final gathering" as well, and what would you use to emulate it? That's right.. a baked AO map.

    Conceded, what im trying to get at is its a utility map, not a simulation of accurate light phenomenons.. which in hindsight is pretty off topic on a realtime rendering board.

    Out of interest Perna are you talking about masking lighting from a pre calculated cube map or can you actually get scene specific colour bleeding going? wouldnt that require ray tracing.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Cheers Per. I took a look at the crytek method. its pants wettingly cool. I wonder if this is similar to what maxes Quicksilver uses.

    newho ill stop derailing the topic now :)
Sign In or Register to comment.