by Ryan Bird
UV mapping is the process of manipulating a 3D mesh’s texture coordinates (U and V) to work with a 2D image, used as a texture. Mapping UVs correctly ensures that a texture will look good on a mesh, with little to no texture stretching or seams.
Depending on the media a model is being made for, character UV techniques can vary. When I worked on video games, I had to apply UVs to anything put in the game: Even if a model was only using a flat color for a texture, it needed to have a UV layout for the engine’s sake. For movie and broadcast models, UV layouts are only necessary for models that need a texture-anything using materials with no maps would not.
Regardless of whether you’re using a model in a real-time environment or as part of a rendered sequence, it is important to make UVs look as nice as possible. Here are a few steps and tips to help you make UV mapping work cleanly and efficiently.
The UV Texture Editor
Becoming familiar with the UV Texture Editor is an essential part of the UV process. You’ll do most of your UV work here. Although the UV Texture Editor contains quite a few tools, I only go over some of the more commonly used utilities. To access the UV Texture Editor in Maya, click Window > UV Texture Editor.
Figure 1 shows the model that I’ll be working on. It’s a low-resolution (about 2,000 polygons) fairy model that could essentially be used for a real-time environment or video game engine.
Figure 1. Low-resolution fairy model
When modeling with basic primitives in Maya, these primitives will bring in their own UV set, unless previously specified. After finishing up the modeling, I’m usually left with UVs that look scrambled, as seen in Figure 2.
Figure 2. An unmodified set of UVs that look scrambled.
Because these scrambled UVs are so confusing and it’s difficult to see what’s going on, I just delete them and start from scratch. From the Polygons menu, clicking Edit UVs > Delete UVs completely gets rid of any UV information, and the UV Texture Editor will be blank.
“Create UVs” Options
Once the initial scrambled set of UVs has been deleted, there are several options-all under the Create UVs menu-for creating a new set. Each option offers a unique way to apply a basic UV set, but I focus on three of them: planar mapping, cylindrical mapping, and automatic mapping.
The planar mapping method is useful when mapping a mesh or set of faces that is flat or points mostly in a particular direction. A good place to use planar mapping on my model would be the wings. I select the wing mesh and click Create UVs > Planar Mapping, then click the Options box.
Because the fairy’s wings are not flat against the X, Y, or Z planes, it is ideal to have Maya figure out the best angle to project from. So, in the Planar Mapping Options window, I select the Best plane check box. Selecting this check box turns off the options to Project from. Also, I make sure that the Keep image width/height ratio check box is selected. After I click Project, I get a solution that is very close to, if not exactly, what I want.
If additional tweaking of the projection is necessary, there is a manipulator handle that, when clicked, allows me to translate, rotate, or scale the projection. Figure 3 shows where the manipulator handle can be found.
Figure 3. The location of the manipulator handle on a planar projection
The cylindrical mapping method is useful when mapping a mesh that is somewhat cylindrical in shape. In my model, cylindrical mapping works best on the arms (not the hands), legs (not the feet), torso, and ponytail. I also use cylindrical mapping for the head. For the fairy, I select the head mesh and click Create UVs > Cylindrical Mapping. Figure 4 shows the initial results of cylindrical mapping in the viewport and the UV Texture Editor.
Figure 4. Initial results of cylindrical mapping, as seen in a viewport and the UV Texture Editor
Figure 4 shows that the UVs extend out past the 0 to 1 coordinates in the UV Texture Editor, because the cylindrical projection has not been closed. To close it, I click and drag the red manipulator handle all the way to the back, as shown in Figure 5.
Figure 5. The cylindrical projections handle and the UV results after closing the projection
Figure 5 shows that after the cylindrical projection has been closed, all but a few straggling UVs fall into the 0 to 1 coordinates space.
The automatic mapping method is useful for complex shapes that wouldn’t necessarily conform to the other mapping options. Automatic mapping makes several different projections for any mesh or faces selected, depending on the direction the individual faces are pointing. To use this method, I click Create UVs > Automatic Mapping, and then click the Options box.
The Automatic Mapping Options window lists options for how many planes you want to project (as few as 3 or as many as 12). There is also a choice for less distortion and more UV pieces or fewer UV pieces and more distortion. It’s good to play with these options to find the best results.
I select the fairy’s hair mesh, and click Project, using the automatic mapping’s default settings. As Figure 6 shows, although automatic mapping provides fairly accurate results, it cuts the UVs up into quite a few pieces. This can be a bit overwhelming, but with a bit of time and some UV tools, you can stitch it together so that you have fewer pieces to deal with.
Figure 6. The results of automatic mapping on the hair mesh in the UV Texture Editor
Using the Sew, Split, and Move and Sew Tools
Maya’s Create UVs tools are a good start to laying out some nice UVs, but most of the time, the UVs require some tweaking. In addition to moving, rotating, and scaling UV points, you may need to cut and sew UV edges.
A good rule of thumb is to have as few pieces as possible. Fewer pieces make texturing much easier and create fewer seams that users can see in the texture once it has been put on the mesh. For my model, the automatic mapping method generates many pieces, so I need to combine them into as few pieces as possible.
First, I start with a large piece, which makes it easier to find smaller pieces to connect. I also like to move this large piece out of the way so that the UVs don’t overlap each other, which can make things confusing.
From this point, I start selecting edges of the large piece. As Figure 7 shows, if there is a connecting edge to another piece, that edge will be highlighted in orange.
Figure 7. The large piece is moved to the side, and you can see the highlighted edges that connect to other pieces.
In the UV Texture Editor, I click Polygons > Move and Sew UV Edges to move and stitch the smaller pieces to the large piece. As Figure 8 shows, I click Sew UV Edges to continue to close up any open edges in the large piece.
Figure 8. The Sew UV Edges button as well as UV edges that need to be sewn together
Now, I focus on the ponytail. As I move it out of the way and select some of the ponytail’s edges, Figure 9 shows that the opposite ends of the ponytail connect to one solid piece rather than to separate pieces.
Figure 9. The outer edges of the main ponytail piece connect to one piece.
To connect these missing pieces, I need to cut them away from the piece they are currently attached to. I select the edges of the pieces that I want to cut away, and then click Polygons > Split UVs. Figure 10 shows that the connecting edges on the main ponytail piece are selected as well as the results of using the Move and Sew tool to connect them to the main ponytail piece.
Figure 10. Before and after selecting connecting edges and using the Move and Sew command
I perform the same steps to connect pieces until I have the desired number of pieces.
Creating a Checker Pattern
During the UV tweaking process, it is good practice to make sure the UVs are spaced and sized appropriately. Because texture maps generally come after UV creation, I use Maya to create a checker pattern to use as a temporary texture. This allows real-time feedback of UV tweaking.
I do this by creating a new Lambert shader in the Multilister. I’m using the Multilister, because I want to see all the shaders and textures at the same time. Clicking Edit > Create brings up the Create Render Node window, in which I click Lambert to add a new Lambert shader to the Multilister.
In the Multilister, I double-click the new Lambert material to bring up the Attribute Editor. In the Color section, I click Map to access the Create Render Node window again. There, I click Checker to apply a checker pattern to the shader. This process is shown in Figure 11.
Figure 11. The steps for applying a checker pattern to a Lambert shader
I apply the shader to the head mesh by selecting it; then, in the Multilister, I select the shader and click Edit > Assign. Once the shader has been applied to the head, Figure 12 shows a of couple of things I need to tweak. First, to work on the UVs in finer detail, the pattern will need to be smaller and the map needs to be sharper (notice that the checker pattern is a bit blurry).
Figure 12. The head mesh after the checker shader has been applied
To make the checker pattern smaller, I double-click the checker map in the Multilister. In the UV Coordinates area of the Attribute Editor, I click Map. When the texture’s placement properties appear, I change the Repeat UV settings to 20 in both fields. (You can modify this number to your preferences.)
To sharpen up the checker pattern, I double-click the Lambert shader. In the Attribute Editor, beneath Hardware Texturing, I set the texture resolution to Highest (256×256). From the Texture Filter list, I select Nearest (Unfiltered).
The last thing I do with the checker pattern is change the white in the pattern to red. I do this because the UV wireframe can get lost in the white areas. To chance the color, I double-click the checker map, then adjust Color 1 to red. Figure 13 shows the improvements to the checker pattern on the head mesh. The UVs will now be easier to tweak, with better visual results on the head mesh. Although the checker map looks good, however, it’s obvious that the UVs need to be tweaked.
Figure 13. A much crisper, smaller, and easier-to-see checker pattern applied to the head
I tweak the UVs by selecting UVs either individually or several at a time. Then, I use the move, rotate, and scale tools to position the UVs so that they flow evenly with the mesh, checking the viewport often to see how the checker pattern looks on the mesh. The goal is to get the checker pattern to spread as evenly as possible on the mesh.
Figure 14 shows the head mesh and its UV set after it has undergone some tweaking as well as additional UV sewing and splitting. The checker pattern now falls much more evenly over the head mesh.
Figure 14. A view of the UV Texture Editor and viewport after a bit of tweaking on the UVs
Positioning UV Pieces to Fit in Allotted 0 to 1 Coordinates
Once I have the UVs laid out for all the pieces I’m going to include in a texture, I begin the process of positioning them into the 0 to 1 coordinate space. I do this by selecting the various pieces by their UVs and using the move, rotate, and/or scale tools to position them inside the 0 to 1 coordinates, as shown in Figure 15. It is also important to use as much of that space as possible.
Figure 15. Final UV layout for the fairy’s head and body, within the 0 to 1 coordinate space.
Additionally, it is essential to make sure that each piece is occupying the appropriate amount of space for the detail that will go into it. For example, in Figure 15, the head is using more space than the other objects, relative to its size. For its purpose, the head is the center of attention and needs more space, because more detail will be going into that area of the texture map. Areas like the feet, which will not be as detailed or don’t have as much focus on them, require a smaller amount of UV space.
Figure 16 shows a render of how the final textures look on the mesh with the completed UVs. When the UVs are done correctly, the texture will look like it falls on the mesh very naturally. Seams and stretching will be invisible or difficult to see.
Figure 16. Render of the fairy model with textures applied.
Compare Figures 15 & 16 to see how more detail was applied to areas of the body that used up more UV space. For example, the head has quite a bit more detail than other areas of the body, which is why it uses more UV space than other parts.
With practice, it won’t take long to master when, where, and how UVs should be applied to a mesh. Becoming familiar with the variety of UV tools discussed in this article will provide great control over UV layouts and allow for quick tweaking.
When done correctly, a good UV set will make painting textures much quicker and easier. The textures created will complement the hard work that goes into making a well-built mesh.
About the Author
Ryan Bird started his career in 1996, at Viewpoint Datalabs*, building content for movies, video games, television shows, commercials, the web, and many other forms of media. From Viewpoint, he worked at Microsoft* Games Studio in Salt Lake City as a Character Lead on several sport franchises. He also worked at Sensory Sweep Studios* as a Team Art Director on some of their biggest titles. Ryan now owns and operates his own business, doing modeling, texturing, rigging, lighting, and animation for professional sports teams, and other big-name companies.