Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

3 Dimensional Chat / 3ds Max Tutorial 1 - Ambient Occlusion

Author
Message
Asteric
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Geordie Land
Posted: 13th Mar 2009 21:35
Hey, just thought i would release a couple tutorials for 3ds max, here is the first, covering ambient occlusion in 3ds max

1. Create a cube with dimensions 40x40x40


2. Add a skylight into the scene


3. Go to Rendering>Light Tracer and activate it


4. Finally render your scene and see the results


Here is a comparison between a default render and a render with ambient occlusion

Default Render


Ambient Occlusion


lazerus
16
Years of Service
User Offline
Joined: 30th Apr 2008
Location:
Posted: 14th Mar 2009 21:26
I think the top render looks better lol, the darkness adds to the effect of the model

Still you showed me where i was going wrong so thxs for the Tut

Asteric
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Geordie Land
Posted: 14th Mar 2009 21:35
no problem, glad it helped

QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 15th Mar 2009 02:14
Did you just copy exactly what I posted in http://forum.thegamecreators.com/?m=forum_view&t=145021&b=3 and make it into a thread?

Asteric
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Geordie Land
Posted: 15th Mar 2009 02:22
@Quoth - Sorry no i didnt copy your post, sorry if it seems that way, its the only technique i learned a while back and i thought i might as well share it

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 15th Mar 2009 05:38 Edited at: 15th Mar 2009 05:40
More importantly, here is how to Render to Texture your AO Map so you can include it in your texturing process. I will be doing a full tutorial on this in the future, but for now, this should be interesting to the able.

This is a chair I have recently made, rendered using AO.



After following the steps outlined by Asteric above, do the following:

1. Add a UVW Unwrap modifier and UV Map your object.

2. Make sure your object is selected and click Render -> Render to Texture.

You should see something like this (the name of your object won't be like mine):



3. Set the mapping coordinates to "Use Existing Channel"

4. "Add" a Lightmap

5. Name your file "file.tga" After this, hit the "..." button next to it. Inside this menu find and click "Setup." Make sure "Bits per Pixel" is 32, and all three checkbox's saying "Compress", "Alpha Split", and "Pre-Multiplied Alpha" are selected. This makes things easier when you bring the AO Map into Photoshop. I'll cover this more in a seperate tutorial, but this step is helpful in working with the texture.

6. Click 2048 x 2048 for your texture size. Debate me all you want, but working with a larger texture size and then reducing the size when your done is not only a good idea but good practice.



7. Render! Walk away, get a bag of chips or a glass of milk and wait for it to finish.

If you get this message, just ignore it unless you want your AO Map to be automatically applied to your model.



My finished AO Map



My diffuse texture sheet after using the AO map



Progress shot



Final



"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 15th Mar 2009 11:24
You can export the maps that it makes??? Wow, that's awesome! Thanks, putting it to use right away!
Aaagreen
17
Years of Service
User Offline
Joined: 4th Sep 2007
Location: City 17
Posted: 15th Mar 2009 12:53
@Sid Sinister: Wow. Wow. You've just tought me how to do awesome things.

@Asteric: Thanks for the handy tip.

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 15th Mar 2009 14:33
Haha, your welcome guys

Another quick tip before I have to go.

In photoshop, set your AO Map to Multiply, and then put your textures underneath on a separate layer. Use the alpha map to select the background color of the AO map and delete it. You can put in another background at the very bottom layer if you wish. This may be confusing, but I gotta run for now.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
bergice
17
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 15th Mar 2009 14:41
Cool, i didnt know how easy it was until now, gonna test it out

NEW: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40ghz 4gb ram 32-bit | OLD: 3.19GHz - 7600GT - 1GB - Windows XP
Visit my youtube profile: http://www.youtube.com/user/bergice1
bergice
17
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 15th Mar 2009 14:43
Btw, we should make a tutorial topic which gives links to all tutorial threads.

Would be really smart as other people might want this later.

NEW: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40ghz 4gb ram 32-bit | OLD: 3.19GHz - 7600GT - 1GB - Windows XP
Visit my youtube profile: http://www.youtube.com/user/bergice1
Asteric
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Geordie Land
Posted: 15th Mar 2009 16:13
@Sid - Very nice, i didnt know how to do that so thanks
@Aaagreen - No problem, i will be doing more complex tutorials soon, or maybe you can ask me what you would like to know, and i will try and make a tutorial?

Game maker wannabe
17
Years of Service
User Offline
Joined: 30th Mar 2007
Location: Dorset, ooh arr!
Posted: 15th Mar 2009 18:29 Edited at: 15th Mar 2009 18:30
Here's what I have made, then added an AO via a skylight.

I will make an AO map when I'm totally finished.






<Insert Signature Here>
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 15th Mar 2009 19:08
Keep in mind that the purpose of including the AO map in your texture is to fake shadows by baking in the lighting into your texture. If you have lights that change in game, it's best not to do this as you'll have some shadows that wouldn't be realistically there.

You can also add an omni light and adjust the intensity to help cast shadows in the direction you want them to.

@Game Maker Wannabe: Nice models! The AO came out well.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
Alucard94
17
Years of Service
User Offline
Joined: 9th Jul 2007
Location: Stockholm, Sweden.
Posted: 15th Mar 2009 19:28
I might make a similar tutorial in this thread on how to render out AO maps in Maya. Give me some time.


Alucard94, the member of the future of the past.
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 15th Mar 2009 19:46
When I bake the ao map, I then put it onto the model's UVs and export it as .x, but when I import it, it is very "patchy", I'll show a picture.

Attachments

Login to view attachments
Alucard94
17
Years of Service
User Offline
Joined: 9th Jul 2007
Location: Stockholm, Sweden.
Posted: 15th Mar 2009 21:14 Edited at: 15th Mar 2009 21:17
Done!
(Oh and sorry for the big images, but this thread was already stretched so it shouldn't make much of a difference)
1. SETTING UP THE SHADER NETWORK

-Open up the model that you want to render AO maps on, I'll just choose this ear here.



-Now you need to dwelve into the jungle that is the hypershade, which is an incredibly in-depth tool of maya's, but for our purposes you really don't need to know anything about it. To do this go to "Window > Rendering Editors > Hypershade".



-This should now have opened the hypershade in a separate window, first what you need to make sure of is to activate "Create all nodes" in the upper left corner if not already on. After you've done this you'll need to create the actual material node that we will be using to connect the ambient occlusion texture into. So simply click the little button that says "Surface shader".



-What you will now notice is that this created a small box in the lower portion of the hypershade with the icon of the previous created material. This is the material node. Now what we need to do is assign the ambient occlusion texture to this node. So on the left bar of the hypershade scroll down a bit until you find the "Textures" category. Unfold this.



-Now you will see other texture "nodes" in this category similar to where the surface shader was previously. What you will now need to choose is the "mib_fast_occlusion" .



-After you've chosen it double click the box that it created, this will open up the attributes of this texture in the attribute editor. This may be opened in the actual maya window or in a separate window depending on what settings you have set. You will most likely see these default settings.



-We will need to change a few things in here, first, change the samples to something like 256, basically, the higher the samples are, the smoother the AO will be. So we want this pretty high. I also tend to change the dark/lights of the AO a little bit just to make the render a bit easier on the eyes. Try to render both with these at default and at a little bit reduced and choose what you prefer yourself.



-Now go back into the hypershade and (If you haven't already) grab the mib_fast_occlusion box in the lower portion of the window and move it to the right a little bit just so that you can see both the surface shader and the AO texture at the same time. Now grab the AO box with the middle mouse button and drag it on top of the surface shader and let go of the middle mouse button. This will bring up a little menu which asks you to what attributes you want to connect the texture to. And for our purposes you just need to choose the "default" option.



-Now comes actually assigning the material to the model, this is pretty straight forward. Simply first select the object/objects that you want the material assigned to, then move over into the hypershade and right-click on the surface shader (Don't select it first, as this will deselect the model) and chose "Assign material to selection". If you've done this correctly your model should now look completely black. Don't worry, that's just the surface shader, once we render it it'll look way better.



-Before we render it we will need to fix a few simple rendering settings. So first go to "Window > Rendering Editors > Render Settings" this will pop up another window where you can chose from a lot of different rendering settings.



-Now, the render settings window will look different in different versions of Maya so I won't actually go in-depth on how it's laid out but you will want to render using mental ray and set the quality preset to "Production".



-Now we basically just want to render it out.



2. BAKING THE AO MAP.

-Baking it is extremely simple really, first of all you will need to change to the rendering menuset. Do this by choosing "Rendering" from the drop-down box in the upper left of the maya window.



-Now go to "Lightning/Shading > Batch Bake (mental ray) > option box.



-These are the settings I got a long time ago from some tutorial and have been using ever since, works perfect for me so it should for you as well. When you have set the settings correctly you'll need to press "Convert and Close" at the bottom of the window. This will start baking the map, now, because we bake it with 256 samples on to a 1024 map this might take a while considering your computer speed. For me it took about 10 minutes, and it'll seem to have frozen but it hasn't it simply is working.



-The image will be baked into your project directory>Your current project's name>renderData>mentalray>lightMap and boom you have a AO map.



Very simple once you get the hang of it.


Alucard94, the member of the future of the past.
Asteric
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Geordie Land
Posted: 15th Mar 2009 21:47
Very nice tutorial Alucard

Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 15th Mar 2009 22:57
Quote: "When I bake the ao map, I then put it onto the model's UVs and export it as .x, but when I import it, it is very "patchy", I'll show a picture."


Hmmm, I'm not sure. If you want to send me the file I can take a look at it.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 15th Mar 2009 23:29
Here it is. You should be able to bake it again and see the "patchyness" in the texture. It is really annoying because I was going to switch from using just csg to using 3ds max and importing it >_< because it is more powerful and you can make better layouts/levels with it.

Attachments

Login to view attachments
Sid Sinister
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location:
Posted: 16th Mar 2009 02:45 Edited at: 16th Mar 2009 02:48
I'm getting a similar problem after viewing the model with the AO map



I think it's doing this because of the way you built your city. Instead of using cubes to make your buildings, you basically just extruded poly's on your plane.

EDIT: I was just tinkering with it some more and now I'm not getting the problem... Not sure what I did.

I would go back and use blocks though, instead of extruding poly's on a plane. I think the problem you had was because the edge wasn't welded and some light was seeping through.

"If I have seen a little further it is by standing on the shoulders of Giants" - Isaac Newton
-Computer Animation Major @Baker.edu-
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 16th Mar 2009 09:35
Ok. I'll try it tonight, thanks for the help.

Login to post a reply

Server time is: 2024-11-25 08:53:38
Your offset time is: 2024-11-25 08:53:38