Content is copyright © KatsBits™ 2000-2013. All Rights Reserved.
No part of this web site may be reproduced (except for personal use) without prior written permission from KatsBits.com. For more infomation on copyright click here.
How to bake normal maps using Blender 3Ds 'renderbump' feature. There are generally regarded to be two ways to generate normal maps from 3D content; "renderbump" and "renderbumpflat". The following tutorial discusses the creation of normal maps in the context of "renderbump", that is, using Blender 3D's own internal ability to 'bake' the topology and physical characteristics of a high resolution, highly detailed 3D object to an image called a "normal map" (#).
An understanding of Blender's basics is required, so being able to move objects, change views and manipulate objects. It's also assumed there are assets available and ready for use - the information below won't discuss how to make high resolution 3D models.
To successfully bake normal maps using Blender 3D a number of items are required before anything can be done;
A low poly 'game' mesh
A high poly 'art' mesh
The "low poly 'game' mesh" is the actual mesh that will eventually be used in game, in this instance a 'tech' door shown on the left of the image below marked "low poly", this should to be 'optimised' as best as possible (as few polygons as necessary for its target use), and must be UVW mapped and textured.
The "high poly 'art' mesh" will be used to provide the geometric detail that's baked to the image applied over the game mesh. The "high poly" version of the door is shown on the right of the image below.
Design note : A third version of the model is often used, called the "control cage", this is optional and more to do with work practices (#).
Because the high resolution object is effectively being baked to the low resolution one, there needs to be a way for the baking process to understand what it's supposed to be doing in relation to both objects. In other words, Blender needs to know where it's supposed to 'bake' (or 'write', 'paint') the coloured normal's, what areas of the texture image should have baked normal's and what areas shouldn't.
For this to happen the low poly mesh must have a functional UVW map with materials and textures assigned.
Taking the example of our tech door, shown below is its UVW map as laid out and occupying a partial section of the available image space; it only uses a section because other objects use the same rusty metal texture sheet; keep that in mind when UVW unwrapping, leave space for other objects where necessary.
Design note : keep in mind that depending on how many assets need to be UVW unwrapped and normal map baked, the distribution and amount of space available for use by any given individual object will need to be adjusted where appropriate (#).
The high poly mesh does not need to be UVW mapped
HOW TO : Create or edit a UVW map
Before doing any UVW unwrapping it's best to make sure the low resolution model has at least one material assigned to the mesh and at least one image/texture assigned to that material, this is important for the normal map baking process.
Note : Render baking is only available with Blender versions 2.45 or above.
For Blender 2.45 only;
In the 3D view, RMB select the object to be UVW unwrapped and then press "F" to enter 'UV Face Select' mode.
Press "A" to select all the UV faces of the object (this may need to be done twice, once to deselect already selected faces, and again to then re-select everything).
Press "U" to activate the "UV Calculation" pop-up menu and select "Unwrap", this will create a basic UVW map of the object.
For Blender 2.46 or above, do the following;
Press "Tab" to enter edit mode as you would normally when editing the mesh
Press "A" to select all the objects faces (may need to be done twice, as above)
Then as above, press "U" to activate the "UV Calculation" pop-up menu and select "Unwrap".
Unwrapping the mesh will create a basic UVW map for the object which will generally occupy the whole image, or as much space as it's proportions will allow.
Note : It is also beyond the scope of this tutorial to cover, in any great length or detail, the various available aspects and features of UVW mapping.
If the model shares the texture sheet applied to it with other objects, that usually means the new UVW map will need to be scaled back to a more reasonable size to allow or compensate for the presence of other subsequent objects on the same texture.
So, for all versions of Blender 2.45 or above, do the following;
Either divide the interface (RMB on a window edge divider, select "Split") so a separate "UVW/Image Editor" is available, or, switch to that view (Shift+F10); the newly created UVW map should appear superimposed over the top of the image that's assigned to the material - press "Alt+Z" to toggle the display of the texture on the model to check.
In the "UV/Image edit" view, press "A" to select UV faces (may need to be done twice as mentioned above), and then "S" to initiate "Scale", simply move the mouse to scale the selected UVW map up or down, LMB to set the move.
This should result in a UVW map similar to the image above, where the map itself occupies an appropriate amount of space on the image.
It's important to note at this point that baking normal maps in this way is a "like for like" process, it's not explicitly a 'projection' - one object being 'projected' onto another - but rather relies on the objects occupying the exact same co-ordinate in 'XYZ' space. In other words, the objects have to sit on top of each other in order for this process to work correctly.
Shown below are both the high and low poly meshes placed at the exact same 'XYZ' co-ordinates on Blenders grid. It's important, at this point, to make sure that both objects are placed exactly on top of each other - it's helpful here if both objects have the same POO ('point of origin' - the little pink spot around which the cursor is usually placed when objects are selected).
HOW TO : precision position control
Assuming that both objects are using the same POO, in order to move or position them with precision do either/or of the following;
RMB click to select and object and hold "Ctrl" whilst moving, this will 'snap' the object to the grid as it's moved.
Press "N" to open the "Transform Properties" panel, in the "LocX", "LocY" and "LocZ" text fields, enter or edit the numbers shown so that both objects use the same values; this ensures both objects are in the same place 'numerically'.
This should put both the high and low objects into the same place; usually confirmed by the presence of something called "z-fighting" - this is the 'flicker' often seen as a result of your graphics card trying to draw coplanar surfaces at the same time (surfaces that occupy the same surface at the same time), as it can't do that, it switches or swaps the rendering of one surface with the other as the object is moved and rendered to the monitor screen.
Once this initial preparation is done to both meshes, it's time to render the normal maps.
WARNING : Do not skip the above steps, make sure the low poly mesh has a good 'clean' UVW map and that both objects are in the exact same place; taking short cuts and ignoring the above will result in poor render results and wonky renders (for more on this see the 'advanced' section).
Baking normal maps with Blender is straight forward, both the high and low resolution versions of the model need to be selected, a few options active and a 'render' button pressed.
HOW TO : render bake normal maps
The order in which the two mesh objects is important so make sure to do this correctly;
RMB select the high resolution mesh first, then hold the "Shift" key down and RMB select the low resolution mesh - of the two meshes the low resolutions outline should be the brighter pink when done in the correct order.
Switch to the "Scene" panels window, "F10", and find the panel titled "Bake".
Click the "Selected to Active" as well as the "Normal" button.
Depending on where the normal map is going to be used, the drop down selection menu - currently showing "Tangent" - may need to be changed to the appropriate setting; for game content this is usually "Tangent", select that setting if it's not already active.
Additionally active the "Clear" button, this will force Blender to clear the texture before it re-bakes the normal map, handy if the process is run several times. "Margin" can also be set which will force a 'bleed' amount to avoid edge anti-aliasing errors.
Click the "BAKE" button to render bake the normal map to texture.
If the UV/Image editing window is open, baking will be visible as the progressive 'live' creation of the normal map as it gets baked to the texture image - depending on how big the image is, it shouldn't take too long to process. The result will be something similar to what's shown below - the normal map baked to the area mapped out by UVW's of the low resolution mesh, all that then needs to be done is to save the image. So;
HOW TO : save the baked normal map
On baking the normal map to image a small "*" should appear appended to the "Image" menu text of the view header once the process is done (it will appear as "Image*" instead of the default "Image"); this indicates there is a new image being held in the render buffer, which now needs to be saved.
Click "Image" and select "Save As...", a file browse window will open.
In the header area of the newly opened file browse window, find the drop down menu "Save Image [image type]", and select an image format that will save the image either in a 'raw' state, or one that uses 'loss-less' compression; suggestions are "Targa Raw", "BMP" or "Tiff".
Click "Save Image" to save the file to the chosen format.
Using Blenders own internal normal map render capabilities is a quick way to generate game ready normal maps and providing the steps above are followed there shouldn't be any major problems - most issues require simple 'tweaks' to fix. There are a couple of caveats to using Blender for this process however, which are discussed in the advanced section.