Jump to content

How to make and use an Ambient Occlusion (AO) bake in Blender 2.79


zero_mass
 Share

Recommended Posts

DISCLAIMER: This tutorial assumes that you can import .mesh files using Blender 2.79. You can find the links to the OGRE import and export plugins and learn how to use them here: https://docs.rigsofrods.org/tools-tutorials/blender-mesh-editing/

Ambient Occlusion (AO) bakes are used to give the effect of shading to any object that might benefit from it. Since I always see people needing bakes for bodies, I decided to try and give you a tutorial for how to make one yourself. It's quite a long process at first, but if you do it frequently then it should get easier, just like most things in life.

I will use the factory settings and layout including the import/export plugins for this tutorial. I hope the large images aren't a problem because I don't know how to rescale them.

When you import a body .mesh into blender, it should look something like this.

gpOPf6e.png

The great thing about the .mesh importer is that it separates each material into different objects.

vA3u6dg.png

(You can press 5 on the number pad to change the perspective as I did for this image)

(And don't move around the objects like that. Just a demonstration)

Right-click on the body until you have selected the inside. When the faces of an object are tinted blue, those are backfaces, which means the faces are textured on the other side. The blue version of the body is the inner fiberglass, which you need to take away because it will conflict with the outer body while baking.

You can delete it, but if you want to keep it then I recommend pressing and clicking one of these squares to move it to a different layer, which you can then access at the bottom of the 3D View area.

r9uN1kQ.pngbD7Or2I.png

You can leave the windshield in view if you want the bake to account for the shading from the windshield.

Right-click on the edge of the Properties area, click Split Area, then drag the line where you want it and click to create a new area. Then click on the top-left dropdown icon of the new area and select UV/Image Editor. This is how you can make a new image and see the bake. You might want to drag the edge of these areas to see more of the UV/Image editor.

87X2oDb.pngfBZSOmD.pngMBH93Xn.png

This is optional, but you might want to press N in the 3D Editor to see the Transform menu, then scroll down to Shading and enable Textured Solid and Backface Culling. This will allow you to see whatever texture is on the body and hide the backfaces.

1zS2dFG.png8QCy290.png

To create an image, go to the bottom menu of the UV/Image editor, click Image, then click New Image. In the following menu, you can adjust the size of the image. For most bodies, you should make the width and height the same to make a square image. I recommend changing the width and height to 4096, which is reasonably high-quality but doesn't take up too much file space. Click OK, and you should be left with a black square as an image.

bdgTDOH.png62Aw5OR.pngIyPEvBC.png

Make sure the body is active. It should have a pale orange outline. Press Tab to ender Edit mode.

JAhau9S.pngBOWYR0B.png

If you see free-floating dots, those are extra vertices that didn't get separated by the converter (it ain't perfect but them's the breaks). Now I have an opportunity to show you how to get rid of em lol.

Go to the bottom menu of the 3D Editor, click Select, then Select All by Trait, then Loose Geometry. Once the vertices are selected, press X, then click Vertices to delete them. I believe it was @WorpeX who first showed me how to do this so shoutout to him!

ymO6lng.pngZMuChPr.pngin8dcjE.png

While in Edit Mode, press A until the whole body is selected. You should be able to see the UV map of the body in the UV/Image Editor. Click on the dropdown menu with the image icon in the UV/Image Editor, then click on the image you made earlier. It should have Untitled somewhere in the name unless you gave it your own title. The body should now be black, which means the image you made is mapped onto it.

mvV8YqZ.pngYD8UikO.png

f7Uzuqh.png

Now there are some settings that need to be changed before we bake the body. Please bear with me lol.

Click the World icon in the Properties area, then scroll down. Make sure Ambient Occlusion is checked, then scroll to Gather. I absolutely recommend increasing the Samples value, which is just the quality of the bake. I use 32 samples for all of my AO bakes, but if your computer is not that powerful then somewhere between 10-20 might be better.

QGhL2kp.pngoaXSZB5.png

Now click the Camera icon in the Properties area, which brings you to the Render tab. Scroll down to Bake.

oxFAVO6.pngh2w43OL.png

Change the Bake Mode to Ambient Occlusion then click Normalized. This makes the bake white which will be most suitable for painting over it. I like to decrease the Margin so that the pixels don't extend too far past the boundaries of the body.

ElvH4EN.png

Click Bake and watch the magic happen! (Maybe it won't be so magical with a budged PC or laptop. Maybe go to the bathroom or grab a snack.)

ilElrTb.pngprofileIcon_ar7flxowyjf61.png?width=256&profileIcon_ar7flxowyjf61.png?width=256&profileIcon_ar7flxowyjf61.png?width=256&

Ta-da! It's baked!

To save the image, click Image in the UV/Image Editor and click Save As Image. From there you can choose a folder in which to save the image and the file name of the image.

a6yk0FW.png

Here is how to get started with painting over a bake.

I use paint.net to make textures, but other image software like Photoshop can certainly do the trick.

LYr2UIN.png

If you want to fill up the transparent space, what you can do is create a new Layer, move it below the original layer, then use the Paint Bucket tool to fill the new layer with black.

4RlmnnM.pngGIeDvI6.png7SDOV0a.pngjNOMuYC.png

After that, click on the original layer, then click Merge Layer Down. This will combine the two layers into one.

SOQy4NI.png4dCQIea.png

Create another new layer and drag it below again. Double-click the top layer and change the Blend Mode to Multiply. Click OK.

mUkauQB.pngmXZsVim.png

In the bottom layer, you can paint underneath the bake and it will appear with the shading of the bake.

 

oJA9GlD.png

You can create as many new layers as you like, as long as they all lie under the bake. At least that's how I do it.

meXC1za.png

100 upvotes and barney the dinosaur will have an official Sim-Monsters release.

I really hope that you found this tutorial useful, but if I see the need for an extended tutorial on exporting the body with the new texture then uhhh im prolly not gonna feel like it. but i might do it anyway. idk. prolly not.

bye

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...