FORUMS: list search recent posts

Controlling the Ambient Occlusion

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeremy Ezekiel
Controlling the Ambient Occlusion
on May 23, 2011 at 3:59:56 am

Hello,

I am trying to understand how to control an Ambient Occlusion Render Layer and I just cant... So here's a summary of my project:

I filmed a piano and tracked the shot. In Maya, I modeled the piano to scale and created a robot spider that walks on it. The end goal is to render out the spider in different passes (diffuse, reflection, spec, Ambient Occlusion, Shadows, glow, etc...) and comp it back in the original footage. There's a picture to help you understand!

Alright so my big question here is:

I want to get the Ambient Occlusion generated by the spider on the different parts of the piano it walks on, but I DONT want to have the AO generated by the piano itself. How do I do that?

I tried turning the Primary Visibility OFF for the piano objects, but then Maya doesn't calculate the AO of the spider on the piano surface. It just gives me the AO on the spider itself.

AND the same goes for my Shadow pass, I want to get the shadow of my spider on the 3d model of the piano, but I dont wanna get the shadows cast by the piano. I tried turning Cast/Recieve shadows/Primary visibility off without getting any good result.

Anyways, if anybody can help me with that, I would greatly appreciate!

Thanks :)


Return to posts index

Ben van Hamelen
Re: Controlling the Ambient Occlusion
on May 23, 2011 at 3:28:04 pm

Have you tried making a separate render layer (layer, not pass) without the piano? I don't know too much about render passes, but that would work. Just select all your geometry minus the piano -> new layer -> add AO and yay!

http://www.fireinthesole.com/


Return to posts index

Steve Sayer
Re: Controlling the Ambient Occlusion
on Jun 1, 2011 at 5:45:32 pm

I don't think this would work because without the piano in that layer, the AO effect of the spider on the surface wouldn't exist.

There is a way to do this, but it's a bit tricky. Check the help files for the mib_amb_occlusion node. There is an attribute called 'id_nonself' which can be used to determine which objects should not self-occlude (which is just what you're looking for). It involves setting an "object instance label," which I think is a special attribute you have to add to the geometry manually.

Look at this help page:

User Guide > Rendering and Render Setup > Rendering > mental ray for Maya rendering > Dynamic Attributes for mental ray for Maya

Now search for the section called 'Label.'

If you can't figure this out, you might be able to get decent results by rendering an AmbOcc pass of the piano without the spider, then one with it, and then do a 'difference' operation on the results in your compositing program. That might let you separate out the effects of just the spider.

As for the shadows, I think a Use Background shader is your best bet. The shadow will show up in the alpha.

Hope that helps.

-Steve


Return to posts index


Jeremy Ezekiel
Re: Controlling the Ambient Occlusion
on Jun 2, 2011 at 6:40:20 am

Omg a million thanks Steve.

I still can't believe that I didn't think of the difference trick by myself. It works just fine! I will definitely try and use the Id_nonself attrib for more serious work.

Just to let you know, I'm a student in VFX at a film school in Canada and I asked pretty much all the teachers and rendering assistants and nobody could give me an answer. So I, and all these teachers, really appreciate your help!!

Thanks again,

Jeremy


Return to posts index

Steve Sayer
Re: Controlling the Ambient Occlusion
on Jun 2, 2011 at 11:28:36 pm

You're very welcome, Jeremy. Unfortunately the documentation for mental ray for Maya seems to be lacking in many ways... and yet it seems like this must be a pretty common effect to want to produce, doesn't it? It should really be made more clear.

I'm glad the difference trick works, but of course it's an inelegant solution; it involves doing more than twice as many calculations and an extra compositing step. Not my favourite kind of workaround!

And, what a coincidence--I teach in a VFX program at a school in Canada. :)

-Steve


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]