GuidesSims 3 Custom ContentTutorials

Baking Shadows with Blender

Baking Shadows with Blender

This tutorial will show you how to automatically create a multiplier using Blender3D (version 2.49) and export it so that it can be converted to DDS for importing into TSR Workshop. This tutorial may be updated for the revamped Blender3D v2.5 user interface once a final, stable version is released.

Introduction

With a new game comes new custom content and new methods of creating that custom content. The Sims 3 (TS3) introduces what may be a new concept to you: Multipliers. Multipliers are an image that is, as the name suggests, multiplied against the pattern being used. The lightness and/or darkness of the multiplier determines where shadows and highlights appear.

You can draw multipliers by hand, which involves a lot of work, or create them in some 3D programs. This process is called “baking.” During the baking process, the program renders the mesh shading that you would find in the real world, and then “bakes” the shadows onto a texture according to the UV Map.

Creating a UV Map to use for baking can be a hassle due to the specifics of how to create a baked image. When creating shading by hand, you can overlap, and you can draw some generic shading that will work for all of the faces. When baking a multiplier, it’s very important that faces do NOT overlap. The 3D program generates a shadow specifically made for each face, and ONLY that face. When two faces overlap and share the same space, the program tries to create each shadow in the same texture space – which it can’t – so you just end up with a big mess, rather than one shadow that works for multiple faces.

Once you have your mesh made and UV Mapped (make sure to note there are no overlapping faces!), baking the shadow map is quite simple. I’m going to assume you have already made your mesh in some other program (or even in Blender, if you know how) and have it properly UV Mapped and ready to go. If you made your mesh in another program, export it out as .obj now to somewhere you can easily find it.

Starting with Blender

Upon opening Blender, you’ll see two windows – a 3D window on top that should have nothing but a cube and a light, and a window on the bottom that is filled with buttons. In the 3D window, the first thing to do is press “Delete” on your keyboard, then click OK to get rid of the cube.

File > Import > Wavefront (.obj). Browse to where you exported your mesh to, select it, and click import. You will see a box that looks like this:

import wavefront

Setting up the Scene

Adjust the settings so the dialog looks like the one above, (Click “Smooth Groups”, change “Clamp Scale” to 0, and turn off “Image Search”) and then click import. Your mesh should now be in the 3D view (although it will appear to be facing the wrong way, this doesn’t matter).

A quick rundown of how to move your mesh around and rotate it: click and drag with middle mouse button to rotate the view; hold shift + middle mouse button to pan the view. The scroll wheel controls zooming in and out.

Look for a dark gray line between the windows that, when the mouse passes over, changes to a double arrow cursor.

setting up the scene

Viewing UV Map and Mesh together

While hovering over that line with the double arrow cursor, right click on that line and choose “Split Area.” A gray line will follow your mouse now, get the line in the middle of the top view port and left click. You should now have two 3D views.

Look in the bottom left-hand corner of one of the windows for a button that looks like a grid. (I’m going to choose the right-hand viewport). Click the grid button, and from the menu that comes up, choose “UV/Image Editor.” One window should now be your 3D view, and the other should be an empty gray UV grid. Press “Tab” on your keyboard, and your mesh should turn pink in the 3D view while the UV Map appears in the UV window. If nothing happens upon pressing tab, click in the 3D window, press “A” then right-click your mesh again to reselect it. Then try pressing tab again.

viewing UV map and mesh together

In the UV Editor window, click the “Image” menu and choose “New.” In the dialog that comes up, change the size of the image to 512×512 (or 1024×1024 if you really need the extra room), then click okay. Your UV map should now be on a 512×512 (or 1024×1024) pure black texture.

Look at the bottom panel now, with the buttons. Towards the top of that panel there will be a series of 6 buttons in one group, and 5 in a second group. Click the 5th button of the second series. It should have a little globe icon on it and be labeled as “World.”

the World button

Enabling Ambient Occlusion

Upon clicking the World button, you will see LOTS of buttons and sliders and numbers. Ignore them, and look for a tab that says “Amb Occ” and click it. It should be in the third set of panels out of the four. Once you click it, click the button that says “Ambient Occlusion.” Change the “Samples” value from 5 to 10.

ambient occlusion

Baking the texture

Looking back at the two series of buttons, click the 6th button in the first series “Scene”, or press F10. Where you found the “Amb Occ” tab before, now look for a tab labeled “Bake” in the same place.

bake tab

Look for a button on that tab that says “Ambient Occlusion” (second button down on the right side of that tab) and select it.

Click the large “Bake” button. It might look like the program is about to crash, but if you wait a few seconds it will start baking, and filling in your UV Map with the appropriate shading and shadows.

baking shadows in Blender

Saving the Multiplier

In the UV Editor window, click the “Image” menu again. Click “Save As.”  Browse to where you want to save it, type in the name you want to save it as, but DON’T click save yet. Look at the bottom of that viewport for a box that has “Targa” in it. Click that box and change it to JPEG. Now you can save it to the location of choice, preferably somewhere easy to find.

saving the multiplier

Because Blender doesn’t have the option to save as .DDS, you will have to open the JPEG you just saved in your graphics program and save it out as DDS to make it usable in Workshop.

Now get to baking!

How do I assign my vertices to joints in Milkshape?

Previous article

Why Is My Window Glass White or Opaque?

Next article