Create a new mental ray shader. Insert the Ambient/Reflective Occlusion map into the diffuse slot, and put a value in the max distance of the AO map.
In your render settings under the Processing tab turn on Material Override and just click and drag the AO material into the blank material slot under Material Override. Now all of your materials in your scene will use this AO material, even though they still have their own shaders applied to them. Before you render, turn off FG, GI and turn off your exposure. If you don't do this you will get a black rendering. All of these settings will not be lost.
The nice thing about this process is you don't have to turn off or delete any lights in the scene, and you still keep all of your materials intact. When you are done rendering the AO pass just turn back on FG, GI, and your exposure...all of your settings will still remain. Also don't forget to disable the Override Material before you go back to rendering your beauty pass.
Hi!
ReplyDeleteYour blog is very helpful! I will come back to see news, nice work!
My blog:
http://maquetestacciarini.blogspot.com/
Why do we need AO? what is it for?
ReplyDeleteSorry if the question sounds stupid. Im newbie to mental ray.
Lime, after you question, I added an explaination to AO : "For those of you who don't know what AO is, it's a method of creating soft shadows in corners where objects meet. It adds an extra sense of reality"
ReplyDeleteThanks, that was pretty helpfull :)
ReplyDeleteBut how do you combine AO and straight render pass? Am I missing something obvious?
ReplyDeleteMetAtroN,
ReplyDeletethis is done in Photoshop. Put the AO layer over the beauty layer and change the mode to multiply to get the result you need.
Thanks for the swift answer :) Minutes after I asked thet question I've found a neat tutorial about this. It really looks cool after both images are combined.
ReplyDeleteDoes this work in the same with Vray aswell?
ReplyDeleteNo. V-ray has its own shaders for achieving AO.
ReplyDeleteIs the example scene lit only by down lights in the ceiling? If so, what is lighting the ceiling in the ao pass if there is no GI?
ReplyDeleteThanks
When the AO shader is used, there is no lighting calculated in the scene. In other words, you would get this same result without lights in your scene.
ReplyDeleteThanx for the tutorial it was v helpful. I noticed u said turn off FG and GI, well I was messing about with setting and turned on FG for fun on the draft preset and noticed it worked just as good. thought I'd let u know
ReplyDeleteGarry,
ReplyDeleteyou're right. Technically you can leave both FG and GI on for this method, and AO will still render correctly. You may get some photon mapping errors with the GI on, but it still works.
Ok this is a dumb question but i used a pro material for the material override. Is that ok? Is there one i should use instead? Besides the samples and distance are there other settings i should be looking at? My image was very grainy.
ReplyDeleteAs long as you're getting the results you want, there is no wrong shader to use. I always use the mental ray material. You can use the promaterial, but it may give you strange results since the pro-materials are always preset at certain values. The one setting that I change on the Ambient/Reflective Occlusion map is the Max Distance. I set it to 3' usually. You can also change your samples from 16 to 32 to get a softer rendering.
ReplyDeleteIf i choose mental ray as a material i dont get have a slot for diffuse?
ReplyDeleteAhhh i just put it in the surface slot and it worked much better. Awesome!
ReplyDeletegreat site! do you know of a way to make the grayscale gradation of the ao a colored gradient map? i would like to have a bright red where the geometry is very dense, then green and blue at the least dense area.
ReplyDeletethanks in advance!
I'm attempting to use this method for an interior room with one window; when I do the procedure and render, my result is very dark with only a hint of any detail. Any suggestions?
ReplyDeletebe sure your exposure is off
ReplyDeleteiancamrillo: just add red to the Dark slot, and green / blue to the Bright slot in the Ambient/Reflective Occlusion Map.
ReplyDeletehi, this is helpful ..
ReplyDeletecan you put the material sample in there .. ?
thanks ..
I added a snapshot of the shader
ReplyDeletehello, like Alex, don't work for me in a scene under a single dome :( (if I hide the dome it work )
ReplyDeleteRamy
ReplyDeletecan you explain the difference between this method and using the AO option that is built into many of the Mental Ray materials?
this method is a "pass" method, meaning it will render everything with just AO only (no colors, textures, reflections, refractions). Then it can be applied to your regular rendering in an editing software such as photoshop. Using AO in the A&D materials applies the AO ontop of the texture so when you render your regular image max will add the AO onto it already. The advantage of doing an AO pass is that you can tweak the amount of it in post production in real-time.
ReplyDeleteThanks man, this was just what I needed
ReplyDeletenice tutorial, one thing which you forgot to mention though was that mental ray needs to be your assigned renderer for you to be able to create a mental ray shader in the first place. You do this by going into render settings, the common tab, then the assign renderer swatch and click the dots beside the "production" label. Here you can change the renderer between the scanline renderer and any other one you have (mental ray). Nice tutorial, extremely helpful :)
ReplyDeletehey, is there anyway to render a scene with AO inside 3ds max for all objects in the scene without rendering AO seperatly without going to another editing software to edit it haha if that makes sense
ReplyDelete@Ramy,
ReplyDeletewhen you posted your example render including the AO-Pass and the beauty pass.. would you like to explain or show us with a snapshot, how the 3 different layers look like and how you combined it in potoshop ?
You wrote you just use Multiply, but when ever I try it it just get's to dark.
@Beauty Pass:
What exaclty do you understand with the beuaty pass ? would you like to post the render of the beauty pass only ?
thank you so much for your great research work.
Heey,
ReplyDeletewanted to thanks for sharing your work with us. Found your blog and it was very helpful..each and every post. i liked the glass ones, and the ink and paint techniques.. i tried them myself.
Thanks..will be checking for your updates.
Great Blog!
hey
ReplyDeletejust wanted to say nice work great blog super useful!
keep 'em comin'
Your Fellow 3D Voyager
I know this is probably a silly question, but is there a trick that allows you to add the AO pass to the beauty pass while it renders an animation? I was just wondering if there was an easy way to accomplish AO in an animation without having to render the beauty, AO, then using multiply in Photoshop on 1000+ frames.
ReplyDeleteHi Ramy,
ReplyDeleteMy image turned out half right and half wrong! some areas are too bright and the ceiling and some elements are quite black.
I need to email you the outcome so you can advise on.
I don't know how to send it to you and appeciate if you let me know how...
Thanks,
Al.
Ramy, thank you for making this! In max 2011 my interior AO is very grey. Is yours too?
ReplyDeletethanks a lot ....
ReplyDeleteGreat for creating rusty mechanical parts too...!
ReplyDeleteGR8, much easier than what I learn in class!
ReplyDeleteThis is great information. The results aren't always what you might expect, and may require some work in photoshop, but this technique is still very useful. I notice this post is several years old - thanks for continuing to keep it available!
ReplyDeletenot works, AO map will be black even with FG GI exposure off. Only the diffuse/complete map is rendered.
ReplyDeleteBe sure you are not using an Environment Map and "Use Map" is off under your Environment settings.
Delete