Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 05-12-2009 , 08:04 AM
DonnieBrasco2069's Avatar
Subscriber
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20

Ambient Occlusion

Hey guys, sorry if this isn't the right forum for this question. I'm new here =)

Okay, so I'm learning Maya and building my scene, but when it came time to figure out ambient occlusion, things got a little nuts. I've heard about 10 different ways to pull this off with not just the mib_amb_occlusion node but also the mib_fg_occlusion node. Here's what I've heard:

1. Attach the amb_occ node to the out color on a surface shader. The problem is I want to be able to render out a frame to see what the finished product is going to look like BEFORE compositing. It also sounds tedious to output the passes of a single frame, go to your comp program, combine them there, and then see what tweaking needs to be done. Using Maya for all this is much simpler.

2. Using Maya render layers to render out an amb_occ pass to all objects in that layer. The problem is the same as #1 - in order to see the finished product, I have to go to comp.

3. Attaching the mib_amb_occlusion node to the shader of an area light. I've actually tried to do this, but I honestly didn't see much difference in the finished product. Has anyone had more success?

My solution: I've actually gotten the best results by doing the following--take your mib_amb_occlusion node, then take an RGB to Luminance utility and connect them (outValue to value). The reason is that amb_occ uses three values and I needed to make them one value for the next step...connecting the Luminance to the DIFFUSE of your model (since DIFFUSE is a single value). This seems to give me very good results which I can render and tweak in Maya, even though I've never read of anyone doing it this way.

So my question is, what's the best way? Has anyone ever heard of the way I did it? I've attached a pic of my model. There only ambient light in the scene is a dome of directional lights set VERY low. Any help or suggestions would be great.

Thanks!

-D

Attached Thumbnails
# 2 05-12-2009 , 06:19 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
I've actually done this before. I don't have Maya open at the moment, but I'll open up the file, and give you a step-by-step.


Imagination is more important than knowledge.
# 3 07-12-2009 , 10:27 PM
ben hobden's Avatar
Subscriber
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
hi Donnie. I wanted to give this a go, but Im no expert with the connection editor and maya utilities. Ive just gone to connect the rgb to luminance utility the amb_occlusion, and I cant see the 'out value' on the rgb to luminance side of the connection editor, but no 'value' on the amb occlusion side. Am i doing it wrong?

# 4 07-12-2009 , 10:58 PM
DonnieBrasco2069's Avatar
Subscriber
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20

Originally posted by ben hobden
hi Donnie. I wanted to give this a go, but Im no expert with the connection editor and maya utilities. Ive just gone to connect the rgb to luminance utility the amb_occlusion, and I cant see the 'out value' on the rgb to luminance side of the connection editor, but no 'value' on the amb occlusion side. Am i doing it wrong?

Actually, you don't even have to use the connection editor if you don't want to! Okay, get an mib_ambient_occlusion node (in mental ray nodes), and then the RGB to Luminance Utility.

Then, in your hypershade workspace, double click the RGB to Lum to open its att. editor. You should see VALUE as the only input.

Next, with the hypershade on one half of the screen and the att. editor for the RGB node on the other, DOUBLE CLICK and HOLD on the amb_occlusion node, then DRAG AND DROP right on the word VALUE of the RGB to Lum utility. Connection made!

Then, double click on your blinn (or whatever you're using for your material). Do the same thing (double click and drag) from your Luminance node onto top of the word DIFFUSE in your blinn's att. editor. Connection made.

You'll have to play around with the amb_occ settings until you get the look you want (increase your Samples and then play with Max Distance), and make sure there's some kind of ambient light in your scene. ALSO, make sure RAYTRACING is turned on in your mental ray settings (Render Settings>Features>Raytracing.

I think that should do it. If you can't get it hit me back =)

-D

# 5 07-12-2009 , 11:28 PM
ben hobden's Avatar
Subscriber
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Hey, yeah, i did it.

Cheers donnie. Although I had no ambient light in the scene. Had several area lights plus image based lighting. It came out very dark. Im working on something else but I thought id just have a go at this. I put it on the blinn shader on the body. Came out very dark..

# 6 07-12-2009 , 11:36 PM
DonnieBrasco2069's Avatar
Subscriber
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20

Originally posted by ben hobden
Hey, yeah, i did it.

Cheers donnie. Although I had no ambient light in the scene. Had several area lights plus image based lighting. It came out very dark. Im working on something else but I thought id just have a go at this. I put it on the blinn shader on the body. Came out very dark..

Mine did, too...no worries, just increase your Max Distance to about 15 or 20. That did it for me =) Let me know how it turns out!

# 7 07-12-2009 , 11:38 PM
DonnieBrasco2069's Avatar
Subscriber
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20

Originally posted by DonnieBrasco2069
Mine did, too...no worries, just increase your Max Distance to about 15 or 20. That did it for me =) Let me know how it turns out!

Oh, and your samples should be no less than 32 (increase as necessary)

# 8 08-12-2009 , 03:25 AM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Here's an easy way to achieve these results:

Color:
user added image

Ambient occlusion:
user added image

Mix (Color + Ambient Occlusion)
user added image

Create two surface shaders. Connect an mib_amb_occlusion node to the default of one of the surface shaders. This will be your ambient occlusion shader. Now, take your normal shader, the one you want to apply the occlusion on to. Display these two in your hypershade's work area. Create a multiply divide node. Attach the normal shader's out color, to input1, and the occlusion shader's out color to input2. Connect the output of this node to the default of the second surface shader you created. Assign this surface shader to your model.

The first shader (your normal) will take care of all shading information. Lighting, transparency, etc. The occlusion is just multiplied onto the normal material, much like it would be done in a compositing application.

Hope this helps.


Imagination is more important than knowledge.
# 9 15-12-2009 , 03:12 AM
ben hobden's Avatar
Subscriber
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
hey donnie, just thought, not sure if i got back to you on this occlusion test. not had alot of spare time,and been trying to progress on my dragon scene with what time i have had.its getting to the point where ive spent so much time looking at it (my scene),its really starting to annoy me.,want to move on. but will try and keep this occlusion in mind. am thinking i need to work more on my lighting and rendering in whatever i do next. the enterprise is looking really cool.very professional

# 10 15-12-2009 , 08:30 AM
DonnieBrasco2069's Avatar
Subscriber
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20

Originally posted by ben hobden
hey donnie, just thought, not sure if i got back to you on this occlusion test. not had alot of spare time,and been trying to progress on my dragon scene with what time i have had.its getting to the point where ive spent so much time looking at it (my scene),its really starting to annoy me.,want to move on. but will try and keep this occlusion in mind. am thinking i need to work more on my lighting and rendering in whatever i do next. the enterprise is looking really cool.very professional

Lighting and rendering are the DEVIL =) This Ent scene was a particular pain because the dock is supposed to be on the far side of the planet (so no sunlight). Arg...it took me awhile to get this combo of point lights and spotlights tuned just right. Global illumination also helps a lot, but adds to render time of complex meshes. A single render of this scene on my comp takes 40 minutes.

Staring at something too long really wears you down. It's good to battle through, but sometimes it helps to take a break and search the internet for new techniques. I can't tell you how many times I've struggled through something, then learned a much better and faster way to do it. You know what they say...the sooner you start, the sooner you can start over =)

Def try this occlusion. It give you really good real-time results, even if it does add to your rendering times. Still, I like seeing the final product before batch rendering an entire scene, which could take a week! Make sure you're rendering with mental ray, too. It's better than the maya renderer, no question.

If you need any good techniques, let me know.

Attached Thumbnails
# 11 15-12-2009 , 11:23 AM
ben hobden's Avatar
Subscriber
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
that looks wicked

# 12 15-12-2009 , 12:40 PM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
That's hot. I don't know if it needed GI though and maybe the blue glow in the front is spread a bit too much.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
# 13 15-12-2009 , 10:11 PM
ben hobden's Avatar
Subscriber
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
are you gonna bump/normal/displace any of this?

# 14 15-12-2009 , 11:34 PM
DonnieBrasco2069's Avatar
Subscriber
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20

Originally posted by ben hobden
are you gonna bump/normal/displace any of this?

It's subtly bumped...you can see from where the part lines pick up the light. I didn't want to make a huge bump because I was going for a smoother look. Not doing any displacement...I'm not very good with it yet and don't see it being very useful here. Not sure what 'normal' means. The face normals are all facing the proper direction. Is that what you mean?

Attached Thumbnails
# 15 16-12-2009 , 12:08 AM
ben hobden's Avatar
Subscriber
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
ah yeah, that is really nice and subtle. By normal, i mean normal map. same as bump mapping really i guess, i think it works a slightly different way, but im no expert at all so i wouldnt take my word for it.

You seem really good are you quite new to maya then? whats the project for/about? apart from it being the enterprise.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads