Hey all! You have probably seen my previous tutorial, introducing Ambient Occlusion. In this post, we are going further into it and learning how to bake (yes, bake) the AO right on the model as a texture. Baking is useful when you want that AO effect in things such as Video Games. So, let’s get started.
I have modeled a low-poly oven model in honor of this tutorial. You know, baking on not in an oven. 😛 So, I’ve turned on AO and quickly rendered it to show you what we’re looking at.
But, we’re not going to be using AO for this tutorial. No sir. We are keeping it off this time. 😉 We are going to use the Bake tool in Blender to simulate Ao. So let’s jump right in.
First, you’ll need a model, as you see above, I’ve make an oven. You can color it using Material Colors. Now visit Edit Mode. Select all (A) and press U for Unwrap. Don’t press Unwrap, though. Press Smart UV Project.
In the next box that comes up, change 0.06 so that nothing overlaps. Now, open your UV Editor Window. First, change your GUI mode to UV Editing.
Once you are in that GUI, you’ll need an image to Bake to. It does not matter what image you are using, the Bake process will replace the image anyway. So I just used a 1920 x 1920px blank (white) image I made in Paint.
NOTE: The larger you image is, the better quality your Baked AO will be.
So go down below the UV Editing Window and press Image>Open Image.
Open your image, check your UV (to see it it is there 😉 ) and you’re all set. Now to actually bake! Go to the corner and drag it to make a nifty little window. Now change the window type to Properties. Then, (in the Render Settings) scroll all the way down and open the Bake tab.
Change the Bake Type to Ambient Occlusion. set the Margin to 2.
Have your model in Edit Mode and press Bake! Baking might take a little while, though, so be patient. The larger the image, the longer the baking times.
OPTIONAL: If you go over the the World Settings, where you normally change the AO sample amount, you can tweak the settings without even having AO turned on. So, if you wanted a better quality Bake, change the Samples amount to a higher one. But higher samples will mean a longer Bake time.
Once it is finished, you’ll see an image pop up behind your UV Map. It is the bake result. Go down to Image>Save Image if you wish to save your Bake over the image you started with. If you’d rather Save a copy, press Save A Copy.
Now you can remove all the Material Colors and make a new Shadeless one and apply your newly-baked texture on it. There you go! Great shading without even needing any lights in the scene! 😀
Approximate Ambient Occlusion
If the Raytracing gather method does not work, or looks bad, I recommend that you use Approximate. The only thing wrong with Approximate is that it produces very dark shadows. To fix that, just light your scene better, for example, add a sun lamp and turn on Indirect Lighting (under the World Settings). That should usually help. When baking, the same concept is used. Baking is just taking what the scene looks like and putting it onto an image or Vertex Colors. Let’s do this step-by-step:
- Set up your scene (which I have already done with my low-poly oven)
- Turn on Approximate Ambient Occlusion.
- Create a new image in the UV Image Editor Window, then go to the Render Settings and Bake (Bake Ambient Occlusion).
- Once your model is finished, you should save your image, duplicate your model (Shift+D), delete all the materials, and make a new Shadeless material and apply your image to it. Render and see if it looks OK. If it does, good! You’re done! If not, keep going…
- If your Ambient Occlusion bake is too dark or had very deep shadows, try turning on Indirect Lighting and adding 1 Sun Lamp.
- As you can see, the first image is too dark, but the second image is brighter without dark shadows. I added 1 Sun Lamp and turned on Indirect Lighting. I also baked Full Render, not just Ambient Occlusion. This way, the Sun Lamp takes effect, and the Indirect Lighting takes effect.
- The Full Render Bake also takes effect for anything, not just Ambient Occlusion. If you have multiple materials, textures, and a lighting setup, it will bake exactly what you see when you render. Also, you don’t have to turn on Ambient Occlusion or Environment Lighting, if you like what you see when you render it, you can bake it. 🙂 It will bake it all into 1 image, so make sure your image is large enough and your UV Maps are set up properly (everything is UV un-wrapped and nothing is overlapping).
If you have any questions, be sure to comment! 😀
Happy Blending–I mean Baking! 😛
Want to try this but don’t have a model to try it on? You can use my Oven! (Link Below). NOTE: On Layer 1 of the model is the original model (with Material Colors) and on Layer 2, is the Baked version of the model.
(See more on layers HERE)