How do i get an ambient occlusion render pass.

   14611   3   2
User Avatar
Member
86 posts
Joined: Aug. 2010
Offline
Man iv tried all sorts of layers…..how do i. Get an ao pass.?
the xon can
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Ambient Occlusion pass is generally considered an ambient light pass devoid of any color. All surfaces are simple diffuse surfaces. This technique doesn't make sense to me with the pbr render engine but you can do it if you wish to control that contribution as a “light”. Read below.

AO can be done as a separate pass where clay shaders are assigned to your objects and then add an Environment Light to the scene and render your pass. This technique works the same for mp/rt and pbr render engines. You can use takes to set this up and put down a take specific Mantra ROP set up to solo just the Environment Light.
See attached example file: scene_with_ao_pass_using_takes.hip

If you are keeping it to the mp/rt render engine(s), you can add an Occlusion VOP to your surface materials and promote the various parameters. Remember that P and N are globals and do NOT need input wires. Wire the output of the Occlusion VOP in to a new Parameter VOP with the name set to the export image plane you want to reference in the Output Driver, the type to at least vector or color if you wish and the Export set to “Allways”. Call it ao or ambient_occlusion or whatever you want. In the Mantra Output driver, you have to create a new extra image plane and set the name to match the parameter and the type to vector.
Note that this technique does not work with pbr.
See attached example file: scene_with_ao_using_occlusion_vop.hip

Since the Occlusion layer can take longer to generate than the primary beauty pass, it may be wise to separate this out as a separate pass as was outlined in the first method using takes. You can create your own shader around the Ambient VOP and create a separate take pass as above and use the mp/rt engine to render this out.

Note that the Ambient Occlusion pass in all three methods above utilize ray tracing. If you want to use different methods to create an ambient occlusion pass, do a search on the OdForce forum on point based ambient occlusion that uses point clouds and not rely on ray tracing. This does introduce minor artefacts as all point cloud acceleration render schemes do but it is faster for moderately detailed scenes. The point based occlusion approach was used a lot in the past but is slowly falling out of favor as machines move to 64 bit with lots of cores to take advantage of plus it's simpler to maintain a raytraced ao pass in a pipeline. If you are familiar with Mental Ray, it does ray tracing based Ambient Occlusion and is somewhat comparable to Mantra's method outlined above.

Attachments:
scene_with_ao_pass_using_occlusion_vop.hip (1.6 MB)
scene_with_ao_pass_using_takes.hip (1.7 MB)

There's at least one school like the old school!
User Avatar
Member
86 posts
Joined: Aug. 2010
Offline
Wow…….ok…..thank u….lemme work on it
the xon can
User Avatar
Member
257 posts
Joined: Nov. 2010
Offline
Hello Jeff,

thanks alot for the explanation! Got questions here and hope you could clear my confused head.

I checked out both files & saw how it was setup to render AO, hit render but it turned out black & white like an alpha channel while the “ao” image plane was empty for me.

You mentioned all the methods suggested required raytracing so i thought i switched the Render Engine to Ray Tracing rather than Micropoly but it did not help.
The file where you demonstrated using envLight had Rendering Mode set to “Direct Lighting”, I am confused why isn't it set to “AO”?

Tried setting up a scene of my own using the VOP method, still couldn't get it to work right. Attached my file below just in case. :?

Cheers thexon for starting this topic, did you face the same problems as me? ><

Attachments:
AOsetup.hipnc (353.5 KB)
ao.png (275.4 KB)
aoAlpha.png (281.6 KB)

  • Quick Links