Members Login
Username 
 
Password 
    Remember Me  
Post Info TOPIC: [How-To] use ambient occlusion maps for materials (UE3)


calculating Pi by hand

Status: Offline
Posts: 768
Date:
[How-To] use ambient occlusion maps for materials (UE3)
Permalink  
 


[How-To] use ambient occlusion maps for materials (UE3)

 
Ambient Occlusion is a feature which is supported by nearly all up to date game engines. However this is a global effect and will only affect real existing geometry. If you have a material that is faking geometry, by using bumpoffset or parallax occlusion mapping for example, and want to achieve the same effect on that material you can make use of ambient occlusion maps.

For more information about ambient occlusion take a look at the wiki link: http://en.wikipedia.org/wiki/Ambient_occlusion

Ambient occlusion maps can be either baked in 3D modeling programs, like 3dsmax, Maya or Blender, from a high poly mesh to a low poly mesh. Or beeing generated out of ohoto ressources with programs like Crazy Bump, Njob or Shader Map Pro.


Adding ao maps via ps/gimp

The easiest way of using ao maps in gimp/ps is to add them in a new layer and change the layer blending to "multiply". This will cause those areas of the texture to become darker, where the ao map is not white. The actual greyscale will cause some spots of the base texture to become darker than others.

untitled19qqu.jpg

 

Another possibility is to create a layer copy of the texture and lowering its brightness. The ambient occlusion is then beeing used as a layer mask and controls the blending between both textures.

This method allows changes without touching the ao map itself. You can also give the texture copy a certain color hue or modifiy it in different ways if you want to.

untitled2erft.jpg




Adding ao maps inside the editor

To add ao maps in the material editor you will usually use a multiply node (shortcut: "m"+"leftclick") and connect it to the diffuse as well as to the ao texture sample. This works quite similar to the layer multiply with gimp or photoshop.

mat1opzz.png

mat2hrq7.png

mat3kqgx.png


In some cases you won't be satisfied with the result. This is where you have to do some changes to the ao map. For example by changing it's brightness, what can be done by multiplying the texture sample with a Constant node (shortcut: "1"+"leftclick"). Values <1 will lower the brightness whilst values bigger than one will make the image brighter. Or by changing the contrast. Therefore you will have to add a Power node and use a Constant node as Exp(onent) input. Again, vaules <1 will result in less contrast and values >1 increasing the contrast.

mat4hqp1.png


If you brighten the ao texture sample (=multiply by >1) make sure to plug it into a constant clamp node (max=1) before the diffuse multiply. Otherwise some parts of the diffuse texture will be brightened, what is usually not what you want to achieve.

mat5arnz.png


Sometimes you don't have the posibility to create ambient occlusion maps or you just think it's not worth the effort. In those cases it is often possible to use a (modified) height map as replacement for an ao map. In analogy to the examples above you can adjust the height maps brightness and contrast to fit your needs. But there is one downside: height maps will usually have parts with a dark grey or even black, what makes the result somehow odd looking. To avoid this you can add a constant clamp node and set its minimum value to anything >0 and <1. A value of 0.5 for example causes medium grey to be the overall darkest color in the height map.

mat6bqv7.png


Conclusion

Ambient conclusion maps can help alot to identify the geometry represented by a material. Espacially if normal maps have no visible effect they are of great use. . To be more exact normal maps cause a less visual effect the more the angle between material surface and its lighting source is close to 90°.
To demonstrate this here are 2 pictures of comparison where the sun is nearly at it the zenith.

1) normal map only, no ao map
mat7gp8v.png

2) normal map + ao map
mat8zqj1.png

On looking closely you can see that the top of each stone has the same brightness on both screenshots. Only the ground and the stones lower parts are darker if using the ambient occlusion map.

 

 



-- Edited by mAlkAv!An on Monday 31st of October 2011 01:46:02 PM

__________________

Blog

Nichts wäret ewiglich, nur die Natur bleibt bestehen.



Connoisseur of Bourbon!

Status: Offline
Posts: 2912
Date:
Permalink  
 

Excellent!
Cheers M8!

__________________

I like playing with stuff!



Amateur UT mapper

Status: Offline
Posts: 736
Date:
Permalink  
 

Thanks for posting, this looks very interesting. :) I will get around to reviewing this more carefully a bit later.

__________________


Amateur UT mapper

Status: Offline
Posts: 736
Date:
Permalink  
 

Just wanted to say thx again for this info, I think I'm alot closer to getting ao now. Your points on shader setup were also quite helpful

__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.



Create your own FREE Forum
Report Abuse
Powered by ActiveBoard