Jump to content

Simple Ambient Occlusion and Blender 3.0


Pierre Ceriano
 Share

You are about to reply to a thread that has been inactive for 804 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello everyone !

Know what ? I went from Blender 2.79a to Blender 3.0 (and today 3.1.2). For me it is like moving from a vintage biplane to a Boeing 747 cockpit :)

I sure have fun with the modeling part in 3.0 version but I'm completly lost when it comes to bake an ambient occlusion map. I watched few tutorials but I'm not satisfied. Most of them are using too much steps and include bump maps and other things I don't need, such as in that thread.

Maybe some of talented pilots would share their settings with the community of creators, I will be very grateful.

Thanks and have fun !

For sample these are my settings in Blender 2.79a for the ambient occlusions I create :

 

 

AO in Blender 279.jpg

Link to comment
Share on other sites

Note that this is using Blender 2.93.5

See @Quarrel Kukulcan post below for Blender 3.0

 

I think the most basic set up for baking AO is the following :

1:  Make sure hat you are using Cycles and if possible change Device to GPU.

2:  In the 3D viewport change the Viewport Shading to Rendered. Next in the Viewport Shading drop-down change the Render Pass to Ambient Occlusion . Doing this will enable us to  preview how the AO is effected on the model as we change the Distance value in the next step.

3:  In the World properties tab enable  Ambient Occlussion and set  Distance to something like 1 m (depends on size of model).

4:  In the Shader Editor  add a new Image Texture node and from there hit the New button and give it a name something like AO Bake. It is very important to  leave this Image Texture node selected (will be highlighted with a thin white border). Highlighting (selecting) this node tells Blender which image to bake to.

5: Go back to Render Properties panel. In the Sampling menu set the Render number to 16.  While doing test bakes keeping this number low will speed up the  AO bakes.  When happy with the bake then bump up this value to something like 32 for a smoother bake result.

6:  In the Bake menu change the Bake Type to Ambient Occlusion.   Check the Clear Image option so that we write over the bake image every time we do a test bake .

7:  Hit the Bake button and with any luck we will see the result in the UV editor.

In the screenshot below options outlined in pink will effect how much AO will be seen on the model  (seen in the preview and baked out in the AO bake image).

278946657_BasicAOBake1.thumb.png.b930b4b623191390d353885ecec714bb.png

 

 

To have more control over the amount of AO on the model we can Add an AO node in the Shader Editor and hook it up to a Math node with its function set to Power. (see screenshot below).

This time for the preview in the 3D editor set Viewport Shading to Rendered as before but change the Viewport Shading drop-down > RenderPass  back to Combined.

In the Bake menu set the bake type to Diffuse and uncheck the Influence > Contributions > Direct and Indirect options.

In the Shader Editor check that the Image Texture node, "bake AO" is still selected then hit the  Bake button and check the results.

This time it is the Exponent value in the Maths Power node that has most effect on the AO.  But also try changing the Distance value in the Ambient Occlussion node. More often than not I have this at around 0.2.

1029992583_AOnodeBake1.thumb.png.346fb43046df44680125b675cbaabfc7.png

 

 

Everyone likes the Color Ramp node so here is another method explaining one way this can be used in combination with the AO node and an Emitter node :

https://blender.stackexchange.com/questions/209358/baking-ambient-occlusion-almost-entirely-black

 

Hope this helps  :)

 

 

 

Edited by Aquila Kytori
  • Like 2
Link to comment
Share on other sites

2 hours ago, Aquila Kytori said:

3:  In the World properties tab enable  Ambient Occlussion and set  Distance to something like 1 m (depends on size of model).

How come I don't have that option when using Cycles? (Blender 3.1.2)

When I'm using Eevee, the setting is available in the Render Properties tab.

image.png.4011607ff222cf3377120303853660f6.pngimage.png.132a308f1888f185f502f1c1e3b9c326.png

Edited by Wulfie Reanimator
Link to comment
Share on other sites

5 hours ago, Wulfie Reanimator said:

How come I don't have that option when using Cycles? (Blender 3.1.2)

When I'm using Eevee, the setting is available in the Render Properties tab.

Looks like it moved to Render Properties > Light Paths > Fast GI Approximation (link I found by chance looking for the manual).

I wonder if AO works differently in Cycles in 3.0+. In 2.8 it added more ambient light to the non-shadowed areas; you needed to use an AO node in your material if you wanted darker shadows.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

After playing around with AO bakes a bit, I discovered something neat about the Ambient Occlusion shader node.

You can bake almost perfect AOs with a single sample.

 

You probably know that rendering anything with a single sample doesn't produce a very good image. If you try to bake Ambient Occlusion directly (with Bake Type), you'll get tons of noise like this (rendered image on the left, geometry on the right):

image.thumb.png.0b2a10a7ea9c31097e7e6842a8ae8402.png

But if you use the Ambient Occlusion node (in the shader editor) with just a few samples and use Bake Type: Diffuse, you can render the same geometry in a single sample and get a much cleaner result, much faster:

image.thumb.png.0f587ddf5602bdd700c22edb9ec90408.png

You can see there's still a little bit of grain in the rendered image but the difference is crazy. Here's an example that was rendered with only 16 samples and high contrast (with the Math/Power node):

image.thumb.png.b99e31d1982a43d0ca3b5ca479803f5d.png

This also applies to the "Viewport Shading: Rendered" option if you also choose the "Diffuse Color" pass. From there you can easily see how few samples you need to get extremely clean results.

Edited by Wulfie Reanimator
  • Like 4
Link to comment
Share on other sites

8 hours ago, Quarrel Kukulcan said:

Looks like it moved to Render Properties > Light Paths > Fast GI Approximation (link I found by chance looking for the manual).

Thanks Quarrel.  I had problems with Blender 3.0 crashing when it first came out so decided to stick with version 2.93.5. I have since downloaded v3.1.0 but from habit continued using v2.93 .

So a couple of screenshots this time Blender 3.1.0 

First is an example of basic  AO bake setup.Using Cycles and GPU.

Note that the default Max Samples is set at 4096. For quicker test AO bakes this can be reduced to something like 32.

574542133_BasicAOBakeBlender3.0.thumb.png.5598a635ea70d447bf7ca02da6b8f294.png

 

 

Setup for more control,  using an AO node connected to a Maths (power) node:

512796652_AONodeBakeBlender3.0.thumb.png.1efb99b29a8daf1324f108cbda7426a9.png

 

 

With a bit more testing using the AO and Math node setup, enabling the Fast GI (Global illumination) Approximation doesn't seem to serve much purpose when baking out an AO map of a single object in a very simple scene. I found similar bake times with Fast GI Approximation checked or left unchecked.

 

Edited by Aquila Kytori
  • Thanks 1
Link to comment
Share on other sites

Thank you from the bottom of my heart :)

Indeed there was an adjustment with the 3.1 version regarding the location of the distance setting.

Also I add a modest contribution : if you use other models in the scene (lower models for sample), to hide them is not enough. Put them in an other collection and uncheck the "Exclude from wiew layer" square, unstead it leads to a weird AO map, like objects are overlaying.

I started weeks ago to try different settings but without your help I would not had the idea to choose the GPU editor and even to keep the image selected ^^

Now I need to adapt the distance and samples, and to use the Math node too. Also I'll have to understand the AO with multiple materials. Today I have made great strides and it is thanks to you all.

My greetings ladies and guys !

  • Like 1
Link to comment
Share on other sites

1 hour ago, Pierre Ceriano said:

Also I add a modest contribution : if you use other models in the scene (lower models for sample), to hide them is not enough. Put them in an other collection and uncheck the "Exclude from wiew layer" square, unstead it leads to a weird AO map, like objects are overlaying.

If you use the shader node (which I would strongly recommend), it has an "Only Local" option, which means that any other object in the scene will not contribute to the render. I've found it to be very handy for more complex models that are meant to "come apart."

Edited by Wulfie Reanimator
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...
You are about to reply to a thread that has been inactive for 804 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...