Dissecting the mib_amb_occlusion node – Tutorial

Using the mib_amb_occlusion is a fast way to produce an Occlusion pass.
It has a great advantage when it comes to render time, as well as the composting process.
Let’s have a closer look at the node attributes.

Assigning to a Shader.

The mib_amb_occlusion node can be assigned to a shader in number of ways.
A- It can be attached to either the Ambient or the Incandescence slot in the Shader attribute.
B- Or in the SG node under the
mental ray section > Material Shader
Each method has its advantage as we will soon discover.
Samples
This filed will control the quality of your AO render. Increasing the sample will render a better quality however it’s on the expense of render time.
Put in mined occlusion mapping will never be as well-tuned as final gather.
0011.jpg

0021.jpg

Bright/Dark
These are the colors that produce the AO, they can be adjusted to your liking.
Note: even though it looks like you can add a node to the checker box, you can’t. it’s just an illusion ;)
0031.jpg

Spread
The Spread value is representing the virtual cone size around the sampling direction.
To better illustrate the spread, place a very small value such as .001 and compare to a high value such as 1.00.
Think of it as shadow blur.
0041.jpg

0051.jpg

Max Distance
This value will determine how far the samples will go.
A zero value is telling mental ray to do it for you automatically.

Tip: when rendering Architectural interiors, it’s a good idea to use a non-zero value in order to get a proper AO pass.
This is simply because the virtual dome (that is responsible for the occlusion) can not see the objects.
0061.jpg

Falloff
This filed get activated once ths Max Distance get a non-zero value.
It will determine the speed at which the occlusion vanishes by distance.

006a1.jpg

Reflective
This is very self explanatory, once you check this flag, the occlusion will reflect on the neighboring surface.
This will be very handy when using a reflective Shader in the scene.
0071.jpg

The Output Mode
These values as follows
0 = Telling mental ray to automatically generate the AO
1 = Environment Sampling (change the camera background color for better illustration, brighter background will produce a better AO)
0082.jpg

2 = Will enable bent Normals (world tangent)
009.jpg

3 = Will enable bent Normals (object tangent)
0101.jpg
The normal passes can be very useful in the composting phase.

Occlusion in Alpha
This option will allow you to have the occlusion appear in the alpha channel.
There are couple of things one need to be aware of for it to occur.
A- Make sure the mib_amb_occlusion node is attached to the SG node of the Shader under mental ray section > Material Shader
011.jpg

In the mental ray render settings > Custom Entities section > Pass custom alpha channel is ON
012.jpg

The rendered image will have the occlusion added to the alpha channel
0133.jpg

Occlusion & transparency
Occlusion by itself won’t respect transparency unless you attach the mib_amb_occlusion node to the Ambient or the Incandescence slot.
016.jpg

Id_inclexcl
This field is somewhat tricky, since for it to work you need to add the attribute “miLable” first using this MEL

addAttr -ln “miLable” -at long “objectName”
0161.jpg

By adding a unique number for each object, you can have more control over the occlusion rendering in the mib_amb_occlusion node,either including or excluding the object form the occlusion.For example > object ID number is 666, in the mib_amb_occlusion node.Id_inclexcl
0 = means no effect
Same value as the ID number = means this only object can cause the occlusion.

017.jpg

 

Negative value of the ID number = means all objects cause occlusion EXCEPT that object.
018.jpg
 

Id_nonself
Very similar to the Id-Inclexcl
0 = means no effect.
Same value as the ID number means this object or objects that match that number will NOT self occlude.

019.jpg

 

TIP: a fast way to get a matte pass is to give all the objects in the scene matching ID numbers, and enable the none-self occlude.

Other usages of the mib_amb_node.

The node can be used for baking AO instead of the built in baking method.

The benefit would be getting more control over the baking options.

In the mental ray baking option, make sure you enable shadows (AO is considered a shadow, since by definition it means blocking the light)

020.jpg 

TIP: As any proper workflow when baking Shaders. the UV map should’t has any overlapping in it.
021.jpg

 

Recent Entries

7 Responses to “Dissecting the mib_amb_occlusion node – Tutorial”

  1. Andrew Says:

    Follow…

    I dwell in possibility…..

  2. anon Says:

    sooo detailed
    thanks

  3. Ionamin Says:

    Great Post, Thanks for sharing it. It is always good to read someone’s else point of view.
    I Have bookmarked it for future use.

  4. omar mansour Says:

    hey man thanks for the insight on the amb occlusion
    cleared my confusion mate

  5. omar Says:

    hey ashraf basha i cant seem to get the transparency to work in the amb occlusion
    although i have followed exaclty
    i attached the mib amb occlusion to the ambient slot of the lambert node
    and to the mental ray shader slot as well
    put in a light and its not working
    what am i missing?

  6. Ashraf Says:

    once you apply it in the mental rya slot, it will take over and wont read the lambert.
    you only assign it to the lambert ambient slot.
    hope this helps

  7. omar Says:

    its working now man thankss

Leave a Reply