• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Ambient Occlusion Tutorial, Max 2012

Messages
10,158
Country
us-arizona
TUTORIAL FOR CREATING AMBIENT OCCLUSION MAPS IN MAX 2012 32BIT

When Max 2012 came out, many changes occured with how one does AO Maps (Ambient Occlusion rendered shading). This explains how to do these in Max 2012 with Mental Ray as the Rendering engine. If you move up from Max 9 to Max 2012, you will need to know this if you do AO maps.



Follow these in order.......................... Must...

Boot up your scene


[RENDERER SETUP]

Open your Renderer Control Settings Panel; F10
Go to Commons Tab/Page
Setup Mental Ray as your Renderer
Go to Processing, tick 'Enable' at Material Override

RendererSetup1-530x992.jpg


RendererSetup2-526x981.jpg




[AMBIENT OCCLUSION MATERIAL SETUP]

* Next, open Material Editor (M key)
* Create a new Material, name it something like Mental Ray AO Material
* Tick on the Bitmap small square at Diffuse
* On the Textures Navigator that pops up, go down to the Mental Ray materials section, find AO, it should be a bright white dot on its icon, select it
* IN your Material Editor, you will find that the texture will have your Ambient Occlusion settings (yes, in the Material in the 'texture' section for
Diffuse). There you want to set up your settings, though later, you will also set this up identically in the Render to Texture control panel.


Settings for the AO texture.
NOTE: You will have many settings, but only a few count, worry only about those few for now.

Samples........Refinement of the shadows; 220 is very smooth, 50 is grainy like mud, great for mud effects by the way
Max Distance...Size of the shadow. Test to see how big it needs to be. Usually 2.0 on some aircraft
Spread.........Darkness. Low numbers are dark, high numbers are brighter, lighter. 0.2 to 2.0. I use 0.8 for now.


* Next, drag the Sphere of the 'Mental Ray AO Material' in the Spheres section of the Material Editor onto the 'material' button of the 'Material
Override' on the Renderer Setup page (F10) that is on the 'Processing' section. (Drag and drop). This will cause the AO Material to show up on 'all'
Materials/Objects when doing a Render 'only'. Otherwise, the AO material is 'not' seen. You can leave this on. Make sure you ticked on the 'Enable'
tick on the Material Override on the Processing Page in the Renderer Setup center.


MaterialEditerAOmaterial-526x857.jpg






[RENDER TO TEXTURE SETUP]

Now open your 'Render to Texture' control panel page, Keyboard shortcut; 0 (zero) on the Keyboard side (not NumPad).

* Select a part in the scene, one you will probably create an AO map for.
* Output, Path, set this to where you want your maps to export to. I use Desktop as I delete the AO maps once I have placed them in the PSD layers.
They are basically no longer needed. (You will only need to do this once, this will be stored in Max memory settings, exporting of Render to Texture target location).
* Tick 'on' Rendered Frame Window.
* Render Settings flyout; 'do not touch', should look like this; ------------
* Object and Output settings; 'do not touch, should also look like this; -----------
* Name; Here you will see your Part you will be exporting. You should see the part name, like Fuselage.
* Selected Object Settings; 'Enabled' (tick on). Padding = 2. Padding is next to this.
* Project Mapping; 'not' ticked
* Mapping Coordinates; 'Use existing mapping channel' 'on'. Channel 1 set.
* Subobjects is locked off
* OUTPUT SECTION: Click Add, find Ambient Occlusion (MR), click Select (This is only done once for doing a group of parts. This sets up the format of the map as well, such as Targa or JGP).
* Selected Common Settings:
-- Enable (tick on), Ambient Occlusion should be in this slot
-- File Name and Type; click on the ... button and select JPG or TGA or what ever you like. Most Maxxers use Targa's, so TGA is standard for AO Maps
-- Use Default Gamma (thats what I use, others may have their own Gamma settings). Click Save.
* Element Background. Use pure black or pure white. I use white, as white is transparent in Photoshop/Layer/Blend=Multiply Only gray is used in the
shading in Photoshop in Multiply layers.
* Use Automatic Map Settings; leave ticked 'off' (do not select)
* Set size of your texture. Note; make a small one and check that its the one you want, right settings in rendering, then go to full size. Scale is
important, as you can then fit your map to your texture perfectly. If you work in 2048 pixels, then make your good AO Map to 2048. For a test, try
512, its quicker to Render.
* SELECT ELEMENT UNIQUE SETTINGS
-- Samples............Quality of Shadow; smooth or grainy, 220 for good, 50 or speckled, 120 for fair.
-- Spread.............0.8 (Test and change if necessary for your model)
-- Max Distance.......2.0 (Test and change if necessary for your model)
-- Falloff............Usually set to 1.0, I never touch it.

***NOTE: The above settings 'should' match your settings in the Material Editor/Mental Ray AO Material/Diffuse texture settings center.
* BAKED MATERIAL SETTINGS
-- Save Source ticked 'on'
-- Duplicate Source to Baked ticked 'on'
-- Render to Files Only ticked 'on' <<< IMPORTANT
-- Keep Source Material ticked 'on' <<< IMPORTANT
* AUTOMATIC MAPPING
(I do not touch these, but here are my settings, just incase)
-- Rotate Clusters ticked 'on'
-- Fill Holes ticked 'on'
-- Threshold Angle....45.0
-- Spacing............0.02
* AUTOMATIC MAP SIZE
(I do not touch these settings, but here are my settings just in case)
-- Scale = 0.01
-- Min....45.0
-- Max............0.02
* VIEWS RENDER (Very bottom, right side of the Render to Texture control panel)
-- Original.....Render ticked
-- Baked........Views ticked


RenderToTexture3-369x961.jpg


RenderToTexture2-378x960.jpg


RenderToTexture1-367x945.jpg


NOTE ABOVE 1: Spread Setting shows 0.2. It should be 0.8.

NOTE ABOVE 2: Be sure, on the bottom of that screenshot above, that you select (tick) on 'Save Source (Create Shell) ', then 'Duplicate Source to Bake', and then especially this one below that; 'Render to Files Only'. VERY IMPORTANT. If you do not have this 'active', then every time you create a new Render to Texture AO map, you create a new Shell Material in your Library. You want to Export the AO Map, not add it into your textures. (That is Baking Textures, we are not doing that here).


[BAKING (RENDERING) AN AO MAP]

* Now, select a part, on your Render to Texture control panel, at the bottom, click Render.
* You should get a warning popup: Warning; There are no photon emmitters in the scene. This is because you have no Lights. Carry on, ignore this.
* If this is your full size unit, it may take a short while to export, like 3 min's plus. A popup window of the Rendering will appear showing progress,
along with another Mental Ray progress 'green bars' mini window.
* When it is done, turn off the popup window. Save your scene, Minimize Max,
* Go to your AO map that should be on your Desktop or where ever you wanted it to export to. Open that with Photoshop. If you have already created
your basic Texture in Photoshop, then open that too and add your new AO Map into the Layer stacks, high in the stacks so the shading is visible and not
hidden. Double click on the Layer and select Blend/Multiply. The image should immediately turn into a soft shading effect in Photoshop.
* Done. Keep doing these, adding them into your Texture. I do 'not' combine these, as the white might override other parts shadings, so I keep these all in separate layers. I also name them; AO Map for each one. Great and much needed for organization of a good PSD file.
* Alt-Tab back over to Max and check your shading on your object(s). Redo if necessary. You want them to be as real as possible. They should be very
subtle. If they are radically dark, they will look horrible later. You want to effect the subconcious of the 'simmer' with the realism of these
shadings, not to overwhelm the visuals.
* You are good to delete the AO Targa maps (on your Desktop) after use. You have a copy of them in the Layers of your PSD files/graphics and you can
make new ones fast enough.


[NOTES]

NOTE 1: You can only make 'one' Render per 'part' or Object. To save time of stacking all the AO Map Layers in Photoshop, you can make 1 or just a few
by Attaching parts in a 'version' of your model. Save a version of your model, Attach parts that share the same Material/Texture. Run an AO Render on
them, done. Discard that version of model later, or detach the parts to restore the model.

NOTE 2: You 'can' do Multiple AO maps at once. Max will generate these one at a time. Each one will be for each part though. Best to test your
settings first to make sure you have the right AO scale and darkness settings for your shadows. To do multiple renders, select several parts, then click
on Render on the Render to Texture button.

NOTE 3: To stop a render, click the Cancel button on the Mental Ray 'bars' progress window. Usually in a 'scene' (3D window, not a render to texture)
you would hit escape, but this doesnt work in the Mental Ray version 'Render to Texture'.

NOTE 4: Supposedly you use 'no' lights in an Ambient Occlusion scene, from what 'some' say at CGSociety. I found that the Renders really do not use
them that much, oddly. I am fairly new to this, and I do know that the pros do use various Lights for this and that appearences. Look for tutorials on
this and experiment. Always experiment and take notes in Notepad on your findings. Store your notes in good places you will find them at later.

NOTE 5: Rendering times and Samples settings. Samples set at 200+ and a map set at 2048 pixels big, with a large part/obejct like a wing, will take a
short while to Render, such as 3 min's, etc. Slower the computer, much longer the Render time. To do test runs, lower the Sample rate and size of the
output texture.

NOTE 6: The Render Window for Render to Texture will 'not' look like the actual Targa map you export. Do 'not' go by the Render Window.

NOTE 7: The Render button on the Render to Texture is the one you need to click on when making a Render to Texture. Making a Rendering (regular
rendering from the Render Setup Control Panel 'will not' create your Render to Texture AO map. You must use the button in the Render to Texture Control
Panel.

NOTE 8: Troubleshooting: Odd things can happen in creating the Ambient Occlusion maps.
* Having multiple objects on the same 'spot' of a Graphics, if the parts are in various locations (like bolts on a canopy or screws on a panel) then
shadings for ALL of those parts will occur, probably making the parts black or dark gray. To repair, make as many bolt texture 'spots' as needed and
render them that way,or just do one part, and place that around the cockpit where needed. Note that the second option is a poor one. You purchased Max
to make these things look real, so use it. Make a bunch of very small spots and take advantage of the system. You can duplicate 'sides' to cut down on
texture 'spots'.
* Dual sided parts (like cockpit structure struts) should be mapped on both sides instead of one Plannar side, or you will have a dark part again in the
AO Map.
* Black triangles; Make sure you have all Polygon Normals facing outward properly. Turn on Cull, make sure nothing is reversed. Another thing that can
cause goofy looking 'render damage' is a part sticking out of the side of the one being rendered, but is reversed, so you do not see it, like the cabin
wall sticking through the fuselage. This will cause a big shading thing to appear on a smooth fuselage surface. So check your model well when these
little flaws occur.

NOTE 9: Render to Texture Settings; Auto Changes. The settings you put in for one part, will sometimes change with the next in the Render to Texture window. The auto-set for Render to Texture settings appears to link to the Mental Ray AO Material / Texture in the Material Editor. Thus, each time you render a AO map on a 'new' part, the RTT (Render to Texture) settings will reset to the Material settings. Thus, if you reset things for doing seats, you will need to remember the seat settings. The RTT Setting will stay with each part (I have found) so you can find the settings on the previous part you did by selecting it, looking at the Render settings in the RTT control panel and duplicating those settings into the next part/selection. So, each time you Render to Texture, check your settings in the Render to Texture
Control Panel.

NOTE 10: When setting up the 'Diffuse' texture in your Mental Ray Material in Material Editor, note that if you do not have Mental Ray 'active' (setup
and on) as your Renderer, then you will not see the Mental Ray Materials or the Mental Ray AO texture that you need for 'Diffuse'. You 'must' do these
in order, you Must have Mental Ray 'active' before setting up your AO rendering Material.

NOTE 11: Perimeter Shading: If you want 'shadows' cast from other objects intermixed on the part you are rendering (answer is yes, that is what this is all about), then you 'must' have other parts around the part being rendered. What ever you leave out of the scene 'during' a render, those shadows will not interact on the rendering when it is generated. Likewise, if you do not want the shadow of the pilot on the seat, then hide the pilot during seat renderings and his shadow will not be on it. Also, if you have the fuselage 'in' the scene and you are rendering seat textures or things in the cockpit, the fuselage polygons have a tendency to block out light, so that might make parts 'darker' then usual, so you you might hide the fuselage to allow more ambient light in to bounce around on the objects. Experiment, experiment, experiment. Do not be afraid to try 5 versions of AO renderings. You want it perfect.

NOTE 12: I find that smaller parts may sometimes use a lower Max Distance setting. If the parts come out too darkly shaded, raise the Spread setting and see how that works. For leather seats and things, use a really grainy AO effect by using a super low Samples setting.


Bill
LHC
 
Last edited:
Hi Bill,

Thank you very much for the tutorial! I just gave it a try and the result looks really good to me.

Actually, it gave me some motivation to continue with my project. The last few days were so frustrating with all those export problems. I was almost ready to dump it to the garbage.. :whiteflag

Thanks again!

Kai
 
YAAAYYYY!!!

For the record Bill, I have Max 2008. The steps are almost exactly as you describe for Max 2012. The results likewise! :wizard:

May your eyebrows never wilt! :D
 
Hi Bill,

Thank you very much for the tutorial! I just gave it a try and the result looks really good to me.

Actually, it gave me some motivation to continue with my project. The last few days were so frustrating with all those export problems. I was almost ready to dump it to the garbage.. :whiteflag

Thanks again!

Kai

Hey Kai,

I was about to as well. 2 or 3 months of trying to get AO maps working, and then the Export issue... Grim. I was talking with a family member about going back to Gmax. I am hoping Arno can get Visibilities working in MCX and we can just use that to export Max models into P3/FSX.




YAAAYYYY!!!

For the record Bill, I have Max 2008. The steps are almost exactly as you describe for Max 2012. The results likewise! :wizard:

Ahhh.. Very interesting. Good to know. I had heard from guys at CGSociety that it was changed radically in 2012. Also heard this on the tutorials in YouTube.


May your eyebrows never wilt! :D

Ahhh.. Arrigatto, gozi-mashta.. (bows humbly while fruffing eyebrows)
 
Bill...

You should try the Vray render when you are baking texture.
Gives so much better result then the mentalray.

Only downside it that it cost....

Good tutorial by the way :)
 
I had heard from guys at CGSociety that it was changed radically in 2012. Also heard this on the tutorials in YouTube.

Maybe the guys are comparing with Max 9, the first version to include AO afaik. The tuts I was looking at before were for Max 9 and I can see differences between them and your tut.

The great thing is I got results with yours! Exits stage right humming Ride of the Valkyries, does little jig... :D
 
Bill...

You should try the Vray render when you are baking texture.
Gives so much better result then the mentalray.

Only downside it that it cost....

Good tutorial by the way :)


Zeiten, I have already spent $4400.00. VRay is another $1100.00, and all it does is render. And... I do not know if it can do Ambient Occlusion, which I found is slightly different then regular, every day renderings. Some rendering engines cannot do AO.

Im fine. This works. Thanks though.

(Yep, I looked at them all, studied just about everything, even Blender.... )
 
Well done, Bill!

Few weeks ago you was lost and asking how to do it, now you're posting very accurate, detailed tutorial for all to use, that I love!

Regards
 
In my case I not use mental ray materials, so it's more straightforward, the objects are scenery buildings not airport buildings even, so not should be so elaborated. :cool:
Anyway can be seen the work inverted in getting the recipe here, and I have searched and read tutorials, really, a great thanks.
 
In my case I not use mental ray materials, so it's more straightforward, the objects are scenery buildings not airport buildings even, so not should be so elaborated. :cool:
Anyway can be seen the work inverted in getting the recipe here, and I have searched and read tutorials, really, a great thanks.

Remember, the only Mental Ray material (MR) is the Ambient Occlusion material that is used in the Rendering Material Override. I still have all my FSX Materials attached to the model.

I create a 'new' Material. I activate MR as my Renderer. I rename the new material as MR AO Material. I click on the Diffuse for that material and locate the Mental Ray Materials/Textures, find the AO material (pure white looking) and then I drag and drop the AO Material on the Material Override in the Renderer Setup control panel.

Then, each time I Render, the Renderer only sees that Ambient Occlusion material/texture by MR. Its only used in Renderings. I can leave it active and it doesnt effect my FSX model exports. ;)
 
Last edited:
And for a 'conventional' render to texture for a vc model or such, you only need disable the material override to use your chosen, non-FSX materials.
 
Last edited:
Yes it's because your tutorial is great, the first problem I see when tutorials talked about other materials was how to keep your own materials and set up.
anyway the mayor problem mostly when reading about mental ray is that every tutorial have his own way of doing things. terrible. every one use a different materials and settings for rendering.
What I observed is going up in the samples value the rendering is endlessly.
 
Last edited:
That's because after the basic method is outlined, this is an art not a science. ;)
 
Yep. Ive seen that one about 20 times, including with pausing, checking my settings with his. Mine would not always work as his did. Mine would be bright white, while his shows perfect. It didnt always work for some reason. (I probably wasnt checking my actual TARGA files though, back then).

It is very good though. Damn good. He has an entire tutorial on making that crate. The UV Mapping tutorial is priceless.
 
:rotfl:
It is very good though. Damn good. He has an entire tutorial on making that crate. The UV Mapping tutorial is priceless.
Odd, because the AO textures I created worked just fine in both the viewport and the sim...

Interestingly enough though, the one new thing I learned is that it doesn't matter a bit where the "skylight" is positioned in Max's world space. I'd always "assumed" that the "skylight" would need to be - you know - "in the sky..."
 
Not on my rig. If I left the skylight at one side, the AO rendered the shading on one side. If I placed several skylights overhead for a blanket of light, it was fine.

Thats why I couldnt understand how his was working fine and mine wasnt.

Just not fair...


It must be my graphics card. I had issues being unable to compile planes in FSDS long ago, and getting a new computer, the issue disappeared. Perhaps its my nVidia 660 that cannot render correctly.
 
660 here and not have that issue with skylihgt, really I didn't like that I couldn't see the effects in the viewport.
Here the "completmap" what is the difference? .diffuse map I guess apply directly in the slot the texture sheet and to the object.
 
Last edited:
The "slot" refers to where the new AO_Map will be placed in the new "Shell Material" that is automatically created.

This "Shell Material" is only used in Max in order for the new AO_Map to be displayed in the viewports. It is not used when exporting the model to FSX...

Once the new AO_Map.tga file is added as a new Layer in Photoshop and Blend/Multiply is set, then the AO_Map will be displayed in Max using the regular FSX Material you created for that object, and the "Shell Material" may be deleted entirely.

Alternatively, if you don't want to go that route, configure the Render to Texture options to automatically remove the "Shell Material(s)" for you and simply use the massaged Photoshop texture in Max's viewport to see the new effect(s).
 
Back
Top