UV Mapping a Human Head Mesh Utilizing LSCM
Derek Marsh (BgDM) - January 25, 2006

Overview

In this tutorial, we will expand on mr_bomb’s  human head modeling tutorial from
Community Journal #2 by taking his completed head mesh and performing a full LSCM UV unwrap with seam placement, editing the UV’s in the internal UV editor and exporting the UV layout for use in Photoshop or GIMP.

For this tutorial, you will need the base mesh blend file, which you can get from
here.

This tutorial also requires that you have a basic understanding of the menus and processes involved in using Blender. If you do not, I strongly suggest that you visit Blender.org and review the docs and do some more basic tutorials to aquant yourself with the interface and just general getting around in Blender.

What are UV's?

UV’s are the way that we describe the “U”, “V” texture coordinates, as opposed to saying the “X”, “Y” and “Z” coordinates of your mesh.

These “U”, “V” coordinates correspond to locations on your mesh, in a 2D plane, that position an image to the meshes surface.

 
- They “pin” an exact spot on the image that you wish to use to texture your model to a specific point on the mesh.
  - Between these points, Blender will stretch the image smoothly across the mesh surface.

What is LSCM?

LSCM stands for “Least Squares Conformal Mapping”, which is a UV tool that preserves local angles of the mesh faces.

Often, a mesh can not be mapped as one group of faces, but must be “cut” into multiple groups of faces. If seams divide the selected faces into multiple face groups, then LSCM unwrapping will unwrap them separately and position them in the UV editor so the faces do not overlap.

Lets get started!

Step 1— Adding Seams to Your Mesh 

Open the blend file and you will see the following on your screen:


NOTE: In Blender 2.41, there is a new feature option for utilizing the subdivision surfaces in the UV editor window. This results in visibly reduced stretching of the textures in the UV's. To turn this option on, go to the MESH EDIT options with "F9" key and press the "Subsurf UV" button. It is located under the "Optimal Draw" button as seen in the above image.

We will begin by marking the seam on the edge just above the forehead area, where the top of the head starts. Select the edges shown in the following images:



Now, starting from the centre of the selected edges, select the edges that go towards the back of the head, all the way to the base of the back of the neck, as seen here:



This will be our first "seam" locations for the head mesh. To "mark" the seam, or to tell Blender to place a seam at these locations, we need to press "CTRL+E". This will open a pop-up menu in your 3D viewport, which is shown here:



Select "Mark Seam" from the menu and Blender will now show the seam in "Edit Mode" as a red/orange line on the mesh:
(Note: Blender only shows the seam locations in  Edit Mode or Face Select Mode)



Now, rotate your model so you are looking at the bottom of the chin and the front of the neck area of the mesh. Select the edges shown in the image below:



Now, as above, press "CTR+E" and select "Mark Seam" from the pop-up menu:



I prefer to add the above seams under the chin area, as it allows for greater control of the faces in the UV editor. I will discuss this in more depth once we get into the UV editor and moving things around.

Step 2 - Face Select Mode and the UV Editor

Here comes the fun stuff.

Now that the seams have been  marked on the mesh,  "TAB" to "Object Mode" and press "F" to enter "Face Select Mode". Make sure that all the faces are selected by pressing "A", (you may need to press it twice in order to have all faces selected). You will know when all the faces are selected when the edges are dotted and not all solid, as can be seen below:



Now we can perform the LSCM unwrap by placing your mouse cursor in the 3D viewport and press "U". Select "LSCM" from the pop-up menu, shown below:



Some notes here on the other options available to you in this pop-up menu:
Step 3 - UV Editor & Pinning Vertices/Editing the UV Layout

First off, In the right hand viewport, currently the camera view, change this to the UV Editor window by selecting it from the menu options in the bottom left corner of the viewport. The initial LSCM unwrap should be shown in the viewport, as seen here:



Not a pretty sight. The initial unwrap is rarely what we want to use for our UV layout. As you can see in the above image, the mesh has been cut in the locations which we designated the seams in the steps above.

First thing we need to do is get everything facing the right way. Place your mouse cursor in the UV Editor window and select all the verts with the "A" key. Then rotate everything until it is basically right side up, see below:



Next step is to start "pinning" some verts in the UV window so they will not move. I select the middle vertice on the top of the forehead seam with the "Border Select" tool, ("B" key or "B+B"), and move it up slightly and move it slightly to the right so it lines up with the darker, middle grid line so it is centered. I then select the top vertice on the left portion of the mesh and the lower left vertice of the mesh. All these vertices are marked in RED in the image below:



Now, in the UV window, press the "P" key to "pin" these vertices. This will turn the vertices red and they will be locked into the position they are in.

The next step is to pin the corresponding verts on the opposite side of the UV layout. Border select the corresponding top vertice. Now, move it to the location of the pinned vertices and line it up. Then move it in the "X" plane by pressing "G" to move and then "X" to constrain it in the "X" plane. Move it across the screen to the corresponding grid line on the correct side and then press "P" to pin the vert. Do the same for the lower vertice. I do this to ensure that these verts will be lined up properly, as seen below:



Now that we have pinned these verts, we can reclaculate the LSCM unwrap. When we recalculate the unwrap, the pinned verts become the points about which the faces will be recalculated and they will stay within that limit as well. Select all the vertices with the "A" key and then press "E" in the UV window. A pop-up menu will appear asking to "LSCM Unwrap", click it and the UV layout will be recalculated as shown below:



As you can see, it is still not perfect, but almost there. Now it's time to see how this UV layout looks on the model. From the "Image" menu, locate the UV Test image, (get it here), and open it. It should display within the grid coordinates of the UV window. Now, move your mouse cursor to the 3D viewport and then press "ALT+Z". This changes the viewport to "Textured View", or as we loved to call it in the old days, "Potatoe Mode". The results of this step are shown below:



As you can see in the 3D viewport, the UV's are backwards. I do not know why this happens, as it does not happen all the time. Fortunately, this is easily fixed. Select all the vertices in the UV window with the "A" key. In the "UVs" menu, select "Mirror" and then mirror in the "X" direction. This will flip the UV layout around and the test image will show properly in the 3D viewport.

For the next step, I move the UV layout outside of the grid space and scale it up very large. This makes the UV test pattern scale on the faces so you can get a better feel for where textyre stretching is occurring.

Next, as in the steps above, I move verts where the seam at the neck and chin area are located and actually merge them together to close up the mesh. Make sure you pin these verts at this seam so they do not move. Then again, recalculate the LSCM unwrap with the "E" key. You should end up with a result that looks similar to the image shown here:



Note that in the above image, I have turned on "Draw Shadow Mesh" from the "View" menu. Also in this image, I had played with some of the new "Live LSCM" features to scale and move verts to get proper face placement to minimize stretching of the texture. This is a relatively new feature and can take up a full tutorial on how to use it properly, thus why I am just mentioning it here. It is fairly easy to use. All you really need to know is that you can only move/scale "pinned" verts with this tool and have them affect the surrounding verts.

Also, you will need to tweak the odd vert here and there, especially around the mouth area, to ensure no faces are overlapping and that they are layed out nice and clean. This is a very time consuming process, but well worth it in the end.

You can see in the "Potatoe Mode" view that the texture is basically properly mapped to the mesh with minimal stretching  and all the "squares" of the image texture are of similar size and shape. As another note, there is an improved UV layout view coming and may be in current CVS, which reduces these small deformations in the squares in the test map. Thus, meaning that the sub-d's are better calculated in the UV window, reducing the stretching significantly. Very cool new feature.

Step 4 - Exporting the UV Layout

OK, the basic UV mapping is now done. Now that wasn't so hard, was it? Time to export the UV layout so we have something that we can utilize to paint textures with.

In the UV window, select the "UV's" menu and then select the Python script from the menu "Save UV Face Layout...", as seen below. (As a side here, what a great script written by theeth. Huge thanks for this one).



This will open a script window at the botom of your Blender screen, shown below:



Now, about the options given to you here:
Once you have input all of the above information, press the "Export" button and wait for Blender to complete the export. You will know when the export is done when you are able to exit the script window.

Step 5 - Loading the UV Layout in PS or GIMP for Texture Painting

Now the fun part begins. Open up your paint program, I use Photoshop 7, but GIMP or any other painting program will basically do the same thing here. Locate the UV layout TGA file that you just exported and open it. You should get something like the following:



I am not going to go full bore into how textures are painted. There is a fantastic tutorial online that you can use, (and I reference it all the time), that I highly recommend, which you should bookmark for easy access. You can see it here. Please note that some of the features presented in that tutorial are not available in Blender. It is intended to be used for reference only. This is the best skin painting tutorial that I have seen, period. This takes you through every step of the process from painting proper bump maps, spec maps, and colour maps.

The main thing to remember when painting textures is to have reference images readily handy. For the textures I painted, I utilized the front reference image that mr_bomb provided in CJ #2. This is used for picking skin tone colours and using them in the texture painting process. As you can see below, I have it open along side the UV layout which makes colour picking a breeze.



Conclusion

As you can see, there is no easy way to get out of making good textures for your models. UV mapping is the best way to get the best results in your models with properly done textures. For me, there is no alternative for this on organic type models.

There are 4 painted texture maps on the above image, (colour, bump, spec and reflection). I have also added 2 cloud procedural texture layers for some additional colour tones and also a blend texture, mapped to the normals, to simulate a bit of subsurface scattering, (SSS). This is an old fake and works fairly well. My textures are not great for this one, as they were done fairly quickly to get this tutorial finished. Take your time with textures, as the more time taken will yield better results.

The other thing required to make your model "pop" are good base materials. The finished blend file is below for you to download and have a look at the material settings and the additional texture layers that I added to the model as well. Ramp shaders are a very powerful tool and are almost a necessity for characters.

The last thing you want to look into is the lighting of the scene. The lighting setup for this blend file includes a dupliverted spot lamp with very low power, parented to a Level 3 icosphere. This provides a nice global/ambient light to the scene. An Area Light as a key light. A fairly powerful back light and also a low power blue spot light. I also added a couple of SPEC only lamps to help pick up on the spcular highlights more.

Here is the Blend File, (5.5 MB, ZIP File), packed with all the textures. Have a look at it and play with it. That's the best way to learn.

I hope that this tutorial was helpful and that you learned something by following it.

BgDM