SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Lounges / Maya Basics & Newbie Lounge / Ambient Occlusion
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 05-12-2009, 07:04 AM   #1
DonnieBrasco2069
Subscriber
 
DonnieBrasco2069's Avatar
 
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Default 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
Click image for larger version

Name:	uss_ent_drydock_small.jpg
Views:	188
Size:	236.9 KB
ID:	43362  
DonnieBrasco2069 is offline   Reply With Quote
Old 05-12-2009, 05:19 PM   #2
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

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.
NextDesign is offline   Reply With Quote
Old 07-12-2009, 09:27 PM   #3
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

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?
ben hobden is offline   Reply With Quote
Old 07-12-2009, 09:58 PM   #4
DonnieBrasco2069
Subscriber
 
DonnieBrasco2069's Avatar
 
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
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
DonnieBrasco2069 is offline   Reply With Quote
Old 07-12-2009, 10:28 PM   #5
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

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..
ben hobden is offline   Reply With Quote
Old 07-12-2009, 10:36 PM   #6
DonnieBrasco2069
Subscriber
 
DonnieBrasco2069's Avatar
 
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
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!
DonnieBrasco2069 is offline   Reply With Quote
Old 07-12-2009, 10:38 PM   #7
DonnieBrasco2069
Subscriber
 
DonnieBrasco2069's Avatar
 
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
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)
DonnieBrasco2069 is offline   Reply With Quote
Old 08-12-2009, 02:25 AM   #8
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

Here's an easy way to achieve these results:

Color:


Ambient occlusion:


Mix (Color + Ambient Occlusion)


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.
NextDesign is offline   Reply With Quote
Old 15-12-2009, 02:12 AM   #9
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

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
ben hobden is offline   Reply With Quote
Old 15-12-2009, 07:30 AM   #10
DonnieBrasco2069
Subscriber
 
DonnieBrasco2069's Avatar
 
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
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
Click image for larger version

Name:	uss_enterprise_7.jpg
Views:	129
Size:	207.2 KB
ID:	43395  
DonnieBrasco2069 is offline   Reply With Quote
Old 15-12-2009, 10:23 AM   #11
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

that looks wicked
ben hobden is offline   Reply With Quote
Old 15-12-2009, 11:40 AM   #12
Gen
Moderator
 
Gen's Avatar
 
Join Date: Dec 2006
Location: South FL
Posts: 3,499
Thanks: 16
Thanked 645 Times in 567 Posts
Default

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 ||::
Gen is offline   Reply With Quote
Old 15-12-2009, 09:11 PM   #13
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

are you gonna bump/normal/displace any of this?
ben hobden is offline   Reply With Quote
Old 15-12-2009, 10:34 PM   #14
DonnieBrasco2069
Subscriber
 
DonnieBrasco2069's Avatar
 
Join Date: Dec 2009
Location: Santa Monica, CA
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
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
Click image for larger version

Name:	bump_detail.jpg
Views:	107
Size:	107.4 KB
ID:	43397  
DonnieBrasco2069 is offline   Reply With Quote
Old 15-12-2009, 11:08 PM   #15
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

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.
ben hobden is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.