Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

3D Craftworks: Texture Baking


Recommended Posts

Craft_Bake_Title.png

WTR_Render.png

Rendered in Blender (Diffuse Map, Normal Map, Specular Map)

Contents:

  1. Normal Maps
  2. Ambient Occlusion
  3. Colour Blockout
  4. GLSL Shader (Real time Viewport Shader)

Introduction:

I'm betting you've heard the term "Baking" mentioned before and I'm sure you were a little confused as to what it is or how you would go about baking in Blender. This workshop is going to cover that :dance:

There are a few different textures that can be baked, we can also view them in real time using the GLSL Shader, the workshop has been broken up into sections each covering one of these.

:smarty: Smarty Says: The workshops here unless stated were written using Blender 2.63.

Link to comment
Share on other sites

Craft_NRM_Title.png

Introduction:

Normal Map baking is the main texture a 3D artist will bake in their 2D application/Sculpting program of choice. Baking our normal maps allows us to make great looking game assets while at the same time keeping the poly count down so the game performs better, we can also cram more detail into our environments.

What we do is make two models, one is our Low Poly model, with this we make the shape our our model and add in any additional details we need to make a nice silhouette. The second model is our High Poly model, with this is we can put in as much detail as we want , don't need to worry about poly counts or UV maps with this.

Once we have our two models we use Blender's Wizardry powers and create a texture with the detail from our high poly model on it :dance:

:smarty: Smarty Says: I am not going to be covering the actual modeling, I'll leave that to you :D

Step 1: Low Poly Model

First step for us is to create our Low Poly model, when creating this model keep in mind that it is Low Poly and not very detailed, just add enough detail in to make a nice shape/silhouette, everything else can be modeled in the next step.

Now for this Workshop I'm working on a wall texture and have chosen to use a single plane for this. The detail will be added in later on.

LowPoly.jpg

Low Poly Madness

:smarty: Smarty Says: Make sure you UV map your model, it's very important you do this now before you move on.

So that's done, I've superbly modeled it as you can see, took me hours XD, It's been UV mapped and is ready for in-game use.

Step 2: High Poly Model

Next step is the High Poly model, this is the part where can have as much fun as you like. When modeling in your detail you have to think about how well it will look when baked and how well Blender will be able to work with your detail. With that in mind make sure you avoid adding tiny details, these won't read well at all when baked and are better off being textured in.

Another thing to note is to make sure you exaggerate your details, what I mean here is when making engraved details make sure you make them deeper than they'd actually be, when working with the edges on your model make sure you loosen the edge loops so the edges are rounder/softer.

This might sound like madness, but it's actually not XD. The reason for this is it helps make a better normal map, the details are read better by Blender and in turn helps it with the baking process.

HighPoly.jpg

High Poly with pretty colours

:smarty: Smarty Says: Here you can see the High Poly has been coloured, this is just to help me visualize things and is not something you need to do, can if you want to though.

As you can see from the image above, I've modeled in just the larger detail, the smaller detail will be added in later during the texturing. I have also exaggerated the edges of my model and made the raised parts higher and the lowered parts lower than they normally would be.

Step 3: Baking

Before we start baking our Normal Map we have to do some prep work, this is very simple and involves selecting our Low Poly Model, going into edit mode and adding a new image.

When baking Blender needs an Image to bake too, so we'll add it now and avoid having Blender throw errors at us.

UVImage.jpg

What we're going to be doing is baking our High Poly model to our Low Poly model's UV map, this is how we fake the detail. Make sure you de-select everything then select your High Poly model, then select your Low Poly one, this makes the High Poly selected while having the Low Poly as the active model.

To the right of the screen you should see a panel with lots of buttons we can press (If you've hid it, show it now), what we want is the baking options which are under the Render Options, so in the tabs on the panel click the camera icon.

RenderOptions.jpg

The panel has a lot of render options, most of these we can ignore, the options we want are right at the bottom. So scroll down until you see the Bake options.

RenderPanel.jpg

First thing we need to change is the Bake mode, currently it's set at Full Render but we want just the normal map, click the box and in the menu that pops up select Normals.

OptionNormalas.jpg

Next we need to check the Selected to Active checkbox, this is an important option for us, it'll tell Blender that we want to bake from our selected model (High Poly) to our active model (Low Poly).

After that we can set the Distance and Bias, the Bias I set to 1 and because I am baking to a flat plane I set a high distance (Anywhere above 100), you can adjust this as you need to depending on what you're baking too.

Last step is to adjust the margin, the margin bakes your normal map over the edge of your UV islands, this helps avoid problems with the texture not properly cover the edges of the model. I set this to 5, it gives me a 5 pixel overlap.

After you've done that hit the big Bake button. The baking may take a while, it all depends on the detail you have on your models.

Once Blender has done it's magic you'll end up with a nice new Normal Map you can use on your model.

Baked.jpg

:smarty: Smarty Says: Brown areas on your Normal Map are flipped normals, you'll need to correct these before re-baking.

Link to comment
Share on other sites

Craft_NAO_Title.png

Currently broken in Blender 2.63

Introduction:

Ambient Occlusion is a baking option that allows us to bake fake shadows for our texture. Blender casts invisible light at our model, this creates shadows, like when we see the sun light hitting a lamp post and creating a shadow behind it. These shadows are then baked onto a 2D texture like when baking Normal Maps.

The advantage of baking Ambient Occlusion is that we can give our textures more depth, which in turn makes them more realistic. I have an example below that shows no AO on the left and AO on the right so you can see the difference.

AOExample.jpg

:smarty: Smarty Says: Because this feature is currently broken in Blender 2.63 (Creates noisy bakes), this part of the workshop will be covered in Blender 2.49b. This will however carry over to Blender 2.6+ once the developers have fixed it.

Step 1: Lights, Camera .... Materials

For this workshop I'm working with a flat 2D plane, so I don't need to use fancy lighting or a fancy camera position. Instead what I do is add my camera over the top of my model, zoom out so the whole model is in view and keep my camera there. For the lighting I do a similar thing, positioning the light above my camera.

You might need something more complex, but that will depend on the model you have and how you want to bake the Ambient Occlusion, have fun and play around.

AOBake01.jpg

Basic setup for a 2D plane

I do something similar with the Material too, I use a very basic grey one with no additional settings like textures, I just make sure the specular channel is black (Off). I have found this gives the cleanest bake as there is nothing else being calculated during the bake, it's all geometry.

Now with the lighting done and the materials set we need to adjust the Ambient Occlusion settings, click on the Camera, now in the details panel click the World buttons option. Click the Ambient Occlusion tab and then press the button to add AO to the camera.

AOBake02.jpg

Using the default AO settings, render the current scene, you'll be able to get an idea of how your setup is working and can adjust things before going further. With a 2D setup like mine you'll be looking at something similar to this.

AOBake03.jpg

Basic settings look pretty good.

:smarty: Smarty Says: Increasing the Samples provides a better bake, but be warned it takes a lot more CPU power and make take Blender a lot longer to generate the bake.

Everything is looking and working well, so now we'll move onto baking the AO texture.

Step 2: Baking

Just like when we were baking our Normal Map, we need to first make sure we have an Image in our Low Poly's UV channel so we have something to bake too. The size of your Image here will also affect the time it takes Blender to do it's work.

After that select the High Poly Model and then the Low Poly one, just like before we're going to bake from the High Poly to the Low Poly. Now press F10 and in the details panel find and click the bake tab.

AOBake04.jpg

From the Bake list select Ambient Occlusion, make sure Selected to Active is pressed, adjust the Margin to the same value used with the other bakes, for me it was 5 and hit the bake button.

If your bake doesn't look quite right you can play around with the settings, you don't have to worry about the distance or bias settings this time.

Once you've hit the bake button, let Blender work it's magic and once it's done you'll be rewarded with a nice AO map for you to use in your project.

AOBake05.jpg

Default Bake settings

Link to comment
Share on other sites

Craft_Blockout_Title.png

Introduction:

As you can see my model has a few different areas that I've coloured differently, now if I were to try and texture it I could mask out each area and fill them with the desired colours. This would work perfectly well, but it'd take a while and might be a little tricky.

Luckily for us Blender has another bake option we can make use of, the Texture option. What this allows us to do is paint each section of our model a different colour using multiple Materials and then bake the model as-is with the material colours. This will create a nice colour block out that we can save and use later in PS/GIMP.

Step 1: Setup

To apply different materials what we do is select our High Poly Model and go into Edit mode, Select an area or multiple areas you want to colour (One colour at a time), like so:

SelectedArea.jpg

Pre-coloured Green, meh don't like it, let's change it

Now in the Pane on the left, click the Materials Tab:

MaterialTab.jpg

At the top of the Material Tab you will see a box and to the right of it are Plus and Minus icons, click the Plus Icon to add a new material slot into the box. At the moment this is blank so what we need to do now is click the New Button below the box to add a new material into this slot.

AddMat.jpg

Now you set a new Diffuse colour, make sure it's a bright colour and different to what you've added before. The brighter colours make the selections easier in PS/GIMP. Underneath the Material box is an Assign button, click it to apply the material to the selected part of the model.

AssignMat.jpg

Step 2: Bake

This part works just like before, we just have to change one option, so before we do it make sure your High Poly is selected and the Low Poly is active. Then go into the Render tab and change the Bake Mode to Textures and click bake.

Once the baking is done you'll end up with something like this you can save:

ColourBake.jpg

Pink colour optional

Link to comment
Share on other sites

Craft_GLSL_Title.png

Introduction:

One of the new features you'll find in Blender 2.5+ is it's ability to use shaders in the Viewport window. What this means is you can easily display your Normal Maps, Specular Maps etc in Blender in Real time. The textures will react to light as they should too, which means you can get great screen grabs without having to wait for long renders.

What we're going to do is add our Normal Map from earlier to our model and setup Blender so the Normal Map displays in real-time.

Displaying the Normal Map

What we need to do is add a Material to our Low Poly Model, then click over to the Textures Tab (Checker board icon), click to add a new Texture. Change the Texture Type to Image or Movie and then open our saved Texture from earlier using the Open button.

GLSL01.jpg

Scroll down to the Image Sampling section and us the arrow to expand the area, now check the Normal Map check box and make sure the box under reads Tangent.

GLSL02.jpg

In the Mapping section change the Co-Ordinates to UV, scroll down a bit to the Influence section. Uncheck the Colour option under Diffuse, then check the Normal option under Geometry.

GLSL03.jpg

Next step is to make the texture show up, so first change the view mode to Textured instead of Solid. Next press N to bring up a smaller panel to the right.

GLSL04.jpg

Next click the arrow for the Display options to expand the view, scroll down a little and change the Shading to GLSL and check the textured Solid box. You should now see your Normal Map being displayed on your model.

:smarty: Smarty Says: If your model is black instead of textured then you've most likely forgot to add a light into the scene.

GLSL05.jpg

Normal Map and Friends

I went a step further and followed the steps above (Tweaking where needed) and applied all three of my textures to my model and have them displaying in real-time in the Viewport.

GLSL06.jpg

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.
Note: Your post will require moderator approval before it will be visible.

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...