The goal of the UV unwrapping process is to flatten the 3D mesh in a 2D space in order to project textures (2D images) on it. To understand the process better, imagine that we are going to remove the skin of our alien in order to flatten it (I know that the metaphor is a little gory, but stay with us, there won't be any blood). If we have to do this, we would need to detach the skin by cutting along the imaginary seams and then flattening it down.
Another way to better understand UV unwrapping is to think about how clothes are made and take the steps in the reverse order. For instance, at the beginning, a shirt is a flat piece of tissue where all the seams are marked down. Then, the different cut pieces are attached together in order to form the volume of the shirt, like the sleeves. So, if we were unfolding a cloth along its seams, we will tell Blender where the seams are placed on our 3D mesh. After this, the ones that have been marked and the model that has been flattened down will correspond to each vertex, edge, or face between the 3D model and the flattened version of it; this is actually a 2D representation of the geometry.
In general, we call the coordinate axes of a 2D space the x and y axes, but in this case they are named as U and V. Hence, the name UV unwrapping process. Another really important thing to note is that we often want to avoid any overlap of geometry in the UV space. This is because when we use UVs of an object in order to project 2D textures on it, we seldom want to have the same texture information twice on the 3D model. We will also need to optimize the UVs so that they don't generate strange distortions.
Lastly, similar to the shirt example, our UVs will be usually separated in different parts called islands. For instance, we will disconnect the head of our alien from its hands or other limbs. These islands need to have a proportional scale to the geometry data they represent (that is, the head is bigger than the hands, so it needs to be bigger in the UV space).
The placement of the seams
It's now time to unwrap the UVs of our alien character. So, as we stated before, we first need to tell Blender where the seams are going to be:
- We will first select all the edges that start from the lower back of the neck to the middle of the forehead (the ones that are on the symmetry axis). We can also select four perpendicular connected edges together at the end of the previous group of edges selected. It will look like an inverted T shape from the front view.
- Now, in order to mark our selection as seams, we will go to the Edges menu (Ctrl + E) and select the Mark seam option.
- Always try to think as if you were using a cutter, so the mesh will be disconnected in the UV space along the marked edges. Also, note that the seams are in red.
- Now, we will select the top collar edge loop (press Alt and the RMB) where it meets the previously marked edge and mark it as a new seam again. This will completely separate the head and neck portion into a new island.
- In order to have less deformation under the chin, we will select edges starting from the top of the collar (where we placed the seam) to the chin along the axis of symmetry. We will add five perpendicular edges to our selections and mark our selection as new seams. We've done this in the same way as the forehead.
- In order to separate the antenna in its own island, we will select the circle loop of its base and mark it as a seam. We will also have to mark a vertical line of edges that start from the previously marked seam and end at the top of the antenna.
- Then, we will end this seam by following the circular cap of the top of the antenna without closing it completely, leaving an edge unmarked. When you are marking the seams, try to think of an approximation of the shape that you know in the real life. For instance, in this case, the antenna looks like a candy wrapper.
- To end with the head, we will select an edge loop around the eye and mark it as a seam. If you want to remove a seam, you can simply select a seam, and in the Edges menu (Ctrl + E), you can select the Clear Seam option. We've now completed the UVs of the head, but we will finish the body before looking at them unwrapped.
- Now, we will select a vertical edge loop around the shoulder and mark it as a seam. This is going to represent the separation between the arm UVs and the torso UVs.
- In order to clearly see that the arm UVs are disconnected from the rest of the body, you can go in the Face mode, hover your mouse on the arm and press the L key (selection of the linked parts).
- We will then separate the torso UVs from the legs by marking an edge loop situated under the belt.
- It's best to consider the torso UVs as two separate islands, the front and the back. So, we will split this by marking the edges that connect the shoulder's vertical seam to the seam of the collar. These edges follow the angle created by the neck and the shoulder.
- After this, we will mark a line of edges that start under the arm and go right to the belt seam. As you can see, using the linked parts method presented before, the torso is now in two parts that are delimited by the collar, belt, and shoulder seams (of course, we always have the mirror modifier turned on, so we can only see half of the torso's linked parts)
- We will then mark an edge loop that follows the top boot outline.
- As we did with the torso, we will split the legs UVs into two islands. To do this, we simply mark the edges that start from the belt seam (following the same direction of the seam on the side of the torso) and end at the boot seam.
- For now, the legs are still in one part, so we will add a new seam starting from the boot seam and ending below the pelvis bone. Now, our legs UVs are split into two islands.
- It's now time to mark the seams of the boots. To do this, we will to the bottom view (Ctrl + 7 numpad key) and mark a loop that follows the footprint of the boot. We will also mark the loop that follows the hole of the boot on the calf muscles.
- We will then mark the vertical edges of the back that connect the footprint seam to the hole seam and the ones that connect the hole seam to the top boot outline.
- Lastly, we will mark the seams of the hand and the arm. We will mark the wrist edge loop in order to disconnect its UVs from the arm. Now, we will mark a continuous line of edges that start from the tip of the thumb and follow the silhouette of the hand by connecting to the wrist seam. As you can see, we didn't split the top of the thumb so that the interior palm and the back of the hand share the same UV Island. Then, we will mark a continuous line of edges from the wrist to the shoulder in order to do the UVs of the arm.
Congratulations! You've finished marking all the seams, and we are now ready to unwrap the alien. In order to do this, we must first apply our Mirror modifier. As you can see, all the seams are now mirrored to the other side; what a time saver!
- Now it's time to unwrap the alien. Let's see how this is done. We will first select all its geometry by pressing A.
- Now, we will press the U key to get the UV Mapping menu and select the Unwrap option. Unwrap is now done!
- To see the UVs, we will open a new UV/Image Editor by splitting our 3D view into two and changing the new window to the appropriate editor.
The seams follow the volume of the each part of the character.
As you can see, in the Edit Mode, all our 3D geometry is being flattened down in the UV space. We are now ready to reorganize each island. Note that if you still have problems while understanding the relation between the 3D space and the UV space (don't be disappointed if this is the case, UVs are hard to understand in the beginning), you can use the linked method presented before to see how each part is represented in the UV space.
The placement and adjustment of the islands
We are now going to adjust each island in the UV space. As you can see, all our islands are bounded to a square. Everything that is on the outside won't be used, so all the islands need to be tightly packed in it. Moreover, we'll have to check whether there are any important deformations on our 3D mesh. If this is the case, it means that each texture will be stretched whether we want it or not.
- In order to adjust the different island placements, in the UV/Image Editor, we will first need to enter the Island UV selecting mode.
This allows us to select every island and place it with the grab (G) tool, scale (S) or rotate it (R) in the UV/Image Editor.
- When we try to place the islands correctly on the UV space, we need to be sure that they don't go out of the square bounds (represented by a grid).
- You can also use the Pack Islands tool located under the UVs menu, in order to have this automatically done. But it's always best to do it by hand.
- Another thing to remember is to have the island proportional in scale to what they represent on the mesh. This was automatically done when you first unwrapped your mesh, but if you scale the islands by hand, be aware of this. However, you can sometimes counter this rule when you need more texture details on a specific location. For instance, the head is one of the most important part of the alien, so we can scale its island a little bit more.
- Once you've packed all your islands, you can add a checker texture to check whether there are any important stretches with your UVs. We will add a predefined texture by first entering into the Edit Mode of the alien.
- We will click on the + New button in the header of the UV/Image Editor, and select a UV Grid image under the Generated Type drop-down menu. We can then validate it with OK.
- In order to see the test grid on our alien in the viewport, we will need to enter the Texture shading mode located under the Viewport shading drop-down menu in the 3D viewport header. We can also toggle it on or off by pressing Alt + Z.
Now that we see our test grid on our alien, how can we interpret it? If all the squares are still approximate squares, then it means we don't have any important deformation. Their orientations don't matter too much here.
Now that we have UVs on our little alien, we can take a look at how we can transfer all the details from our sculpture to the new retopologized mesh. The details in the sculpture are simply there because of the amount of geometry it is composed of, but in the retopology, we have kept the amount of details to about 5000 polygons, in order to have a manageable mesh.
The baking of a normal map
The best solution that we have in order to transfer the details is to bake a normal map that will act with lights to give the impression of detail.
At its lower state, a normal map is an image or a texture that will be projected on the mesh through the UVs. This' is why it's important to UV unwrap the object. Note that if the UVs are stretching at some place, the details that are in the normal map will then be stretched too. As mentioned before, a normal map will do its magic with the lighting. It is composed of red, green, and blue pixels that respectively represent the X, Y, and Z orientations of the normal of a face. So, we will need to create a normal map that will contain all the normal information of the high poly sculpture. The higher the definition of the normal map texture will be, the most precise the details will be.
In order to create a normal map from our sculpture, we will need to use the bake tools of Blender.
- We only need to see the sculpture and the retopology in the 3D view. To hide the rest, we will select them both and press Shift + H.
- We can now deselect all our objects by pressing A.
- In order to do the bake, we will have to first select the alien sculpture and then the retopology (this becomes the active object).
- Now, in the Properties editor, under the Render section, we will expand the Bake subpanel.
- The first option to choose is what type of map (or texture) we want to bake. So, under the Bake Mode drop-down menu, we will select Normal Map.
- The next thing we'll have to check is the Selected to Active option that tells Blender to bake from the sculpture to the active object (our retopology).
- We will then need to add a blank texture to bake our normal map on. So, we enter the Edit Mode of the retopology and click on the + New button (or the + icon on the right-hand side of the texture list), and instead of selecting a UV grid, we choose a Blank texture with a width and height of 4096 pixels.
- Before baking our map, we need to click on the Smooth Shading button; otherwise, we will see the polygons on our bake.
- Last but not least, we will come back to the Bake panel and click on the Bake button. Don't forget to save your map (Image | Save As Image or simply press F3) or it will be lost!
At this point, you should see that the normal map has started to appear. If you get an error message, it may be because you didn't add the texture on the low poly while you were in Edit Mode, or that you've selected the retopology before the sculpture. If you want to have your normal map packed into the .blend
file, you can go to the File menu and select the Pack All into blend file in the External Data subpanel.
Note
About the size of the textures
Usually, textures aren't rectangle. They are set with the power of two of the width and the height. The common sizes are 256 x 256, 1024 x 1024, 2048 x 2048, and 4096 x 4096.
Displaying the normal map in the viewport
Now that we have a nice normal map baked, we will show to you how to display it in the viewport:
- We first need to be in the GLSL mode (press N and select Shading Subpanel | Material mode dropdown).
- We also need to add a new material on our low poly. To do this, we can click on the New material button under the Material tab of the Properties editor.
- We will then go to the Texture tab of the Properties editor and click on the New texture button.
- Under the Image subpanel, we can choose our normal map with the left-hand side drop-down menu.
- Then, we will check the Normal Map check box under the Image Sampling subpanel.
- For now, Blender will only interpret the map as a diffuse map. We want to tell Blender to use the normal information of the map. So, under the Influence subpanel, we uncheck Color slider and check Normal slider.
- Now, we will need to add a light in the 3D viewport (press Shift + A and navigate to Lamp | Hemi) and orient it correctly.
- Lastly, we need to enter the Texture shading mode. We can now appreciate the comeback of our sculpture details. If you want, you can move the light around to feel the relief of the normal map.