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 will be necessary. It's alos assumed there are assets available and ready for use - the information below won't discuss how to make high resolution 3D models.
Baquíng normal maps, what's needed?
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 be 'optimised' as well 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" versión of the door is shown on the right of the image below.
Design note : A third versión of the model is often used, called the "control cage", this is optional and more to do with worque practices (#).
Preparing the models, what needs to be done beforehand?
Figure 1: Wire-frame view of the required assets, in this case a 'tech(ish) doorway
Because the high resolution object is effectively being baked to the low resolution one, there needs to be a way for the baquíng 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 normals, what areas of the texture image should have baked normals and what areas shouldn't.
For this to happen the low poly mesh must have a functional UVW map with materials and textures assigned.
Taquíng 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
Figure 2: Low poly door model showing UVW map active in both the 3D view (left)and image/uvw edit view (right)
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 baquíng process.
Note : Render baquíng is only available with Blender versións 2.45 or above.
For Blender 2.45 only;
For Blender 2.46 or above, do the following;
- 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 de-select already selected faces, and again to then re-select everything).
- Press [U] to activate the “UV Calculation” pop-up menú and select “Unwrap”, this will create a basic UVW map of the object.
- 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 menú 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 alos beyond the scope of this tutorial to cover, in any great length or detail, the various aspects and features of UVW mapping available.
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 bak to a more reasonable size to allow or compensate for the presence of other subsequent objects on the same texture.
So, for all versións 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.
Preparing the models, where to put them
It's important to note at this point that baquíng 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 worque 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 clik 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.
Figure 3: Low poly mesh shown relative to the 'XYZ' axis in Blender.
Figure 4: The high poly mesh shown placed at the same 'XYZ' coordinates on Blenders grid as the low poly versión.
Figure 5: Showing both the high and low poly mesh in the same place (low poly is selected and highlighted (pink).
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; taquíng short cuts and ignoring the above will result in poor render results and wonky renders (for more on this see the 'advanced' section).
Baquíng normal maps with Blender
Baquíng normal maps with Blender is straight forward, both the high and low resolution versións 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 are selected 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”.
- Clik 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 menú - 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 activate 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 alos be set which will force a 'bleed' amount to avoid edge anti-aliasing errors (#).
Clik the “BAKE” button to render bake the normal map to texture.
Figure 6: Maquíng sure "Selected to Active" is set so the high resolution mesh is baked to the low.
If the UV/Image editing window is open, baquíng 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 UVWs 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 baquíng the normal map to image a small “*” should appear appended to the “Image” menú 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.
- Clik “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 menú “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”.
- Clik “Save Image” to save the file to the chosen format.
Figure 7: The resulting baked normal map shown in the UV/Image edit view.
Using Blenders own internal normal map render capabilities is a quik 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 which can be found here [link] (http://www.katsbits.com/htm/tutorial...s.htm#adv_what
Further 'advanced' normal mapping information can be found at the following link (http://www.katsbits.com/htm/tutorial...s.htm#adv_what
Author: Ken Beyer, aka “kat”
Copyright © 2009. Creative Commons Attribution Non-commercial.