PDA

View Full Version : Are Ambient Occlusion Maps outdated?


Anamnacha
05-17-2010, 03:27 PM
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?

Moosey_G
05-17-2010, 03:30 PM
AO maps are for shadows and lighting and Normal Maps are for retaining high poly quality onto to lower poly models.

kdm3d
05-17-2010, 03:35 PM
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
05-17-2010, 03:38 PM
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
05-17-2010, 03:41 PM
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
05-17-2010, 03:54 PM
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
05-17-2010, 03:54 PM
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
05-17-2010, 04:04 PM
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
05-17-2010, 05:24 PM
Thank you everyone!
This is a lot of information and explains everything.

You guys are awesome.

r_fletch_r
05-17-2010, 05:30 PM
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
05-18-2010, 02:16 AM
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
05-18-2010, 06:18 AM
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
05-18-2010, 06:33 AM
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
05-18-2010, 09:42 AM
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 (http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion)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
05-18-2010, 09:46 AM
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
05-18-2010, 11:02 AM
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
05-18-2010, 11:39 AM
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
05-18-2010, 12:16 PM
^That and AO also darkens areas that tend to gather dirt/grime.

perna
05-18-2010, 01:03 PM
Daaark :'(

r_fletch_r
05-18-2010, 01:11 PM
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
05-18-2010, 01:35 PM
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
05-18-2010, 01:44 PM
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
05-18-2010, 01:47 PM
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
05-18-2010, 02:13 PM
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
05-18-2010, 02:20 PM
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
05-18-2010, 02:39 PM
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.

perna
05-18-2010, 02:44 PM
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.

r_fletch_r
05-18-2010, 02:57 PM
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.

perna
05-18-2010, 03:16 PM
r_fletch_r, I refer to the masking part. There's realtime indirect lighting solutions out there, max 2010 has it. The new crysis stuff has it. I would hesitate to bring the topic in an offline rendering direction though.

Regarding what you said earlier about ray tracing solutions; wouldn't that piss off the people who like to manually tweak everything? ;)

We can achieve fantastic results with what we have right now. The key is for artists to try to understand it sufficiently well and not just think of it as arbitrary special effects. If you're just dumping AO maps in because it "makes things more eye-pleasing"... No, I really suggest trying to understand why things are done the way they are.

r_fletch_r
05-18-2010, 03:48 PM
Cheers Per. I took a look at the crytek method (http://www.crytek.com/fileadmin/user_upload/inside/presentations/2010_I3D/20100301_lpv.pdf). its pants wettingly cool. I wonder if this is similar to what maxes Quicksilver uses.

newho ill stop derailing the topic now :)