CHAPTER 5

image

UVs and UV Layout

 

 

So now we have our objects. The tools of polygons and NURBS have been explored, and engaging shapes have taken form. Now what?

Well, the gray plastic shapes we have been creating must be getting kind of old to look at. I always get a bit depressed when I have spent too long in the modeling realm -I need color! And indeed, texturing the shapes created will start to really bring these forms out of the depressing realms of gray and into a colorful world of life.

If we were just slapping a simple color on the objects, we could do that now. However, these forms will have much more life if there is a texture that lays across the geometry. In our hallways, the floors should look like there is some tile or wood on them, the walls have peeling plaster, and the doors — rotting wood. Our little alien character needs to have some parts of his form look like green skin, and other parts appear to have clothing. To do this, we need to be able to manage what parts of a texture are applied to what parts of a polygon mesh.

UVs

So what are UVs? Well, actually — they are a “where” — they are a coordinate system across the surface of polygons (think latitude and longitude across a globe). What this coordinate system does is allow a texture to be “pinned” to the surface, so that the pixels of a texture know where on the surface to stick to.

Understanding what UVs are and being able to manipulate them is incredibly powerful and allows any image to define the surface of a 3D form. It allows the same collection of polygons to appear as a bowling ball, a marble, or a ball of yarn.

Unfortunately, this power to manipulate UV is not a trivial task and can be very counterintuitive. It’s not impossible of course — but getting your mind around how UVs work will take a bit of effort.

UV Texture Editor

The mechanism that Maya has provided to work with UVs is the UV Texture Editor. You can bring this tool up via Window > UV Texture Editor (Fig. 5.1).

image

FIG 5.1 UV Texture Editor with a cube’s default UVs displayed.

Maneuvering with UV Space

Moving within the UV Texture Editor space is consistent with other Maya tools. Alt-RMB will allow the “camera” viewing this space to move close or farther away. Alt-MMB or Alt-LMB will allow you to pan across the space.

UV Texture Editor Interface

There are really a lot more tools available here than we are going to actually use in our tutorials, but here are the core ideas: All of the icons across the top of the interface (and below the pull-down menus) are simply shortcuts to commands available via the pull-down menus. The biggest work area below that will show four quadrants, but only the top right quadrant will (at this point and by default) include any UVs or texture information. So for instance, in Fig. 5.1, there is a dark gray swatch in that top right quadrant that represents the color of the lambert1 material that is the default gray assigned to the new objects in Maya.

The upside-down T shape seen within that quadrant is the default UV for a primitive cube. Think of this shape as the cube if it were unfolded and laid out in 2D space. Each of the squares there represents a face of the cube.

Selecting Components

Right-click-holding on any components of the UV Texture Editor will pull up a Hotbox that allows the user to define what type of component they wish to select for manipulation (Fig. 5.2). These should look familiar as they are the components of polygonal objects that we have been using in past tutorials. The big difference here is that we are dealing in UV space — not 3D space, and so only UVs can actually be manipulated here (moved, scaled, or rotated). The other components such as faces, edges, or vertices can be selected here (and they will highlight in the View Panels (3D space) as well), but they cannot be manipulated within the UV Texture Editor.

image

FIG 5.2 Hotbox within the UV Texture Editor to define what type of component is to be selected.

Tips and Tricks

Note that while components other than UVs cannot be manipulated in this UV space, simply being able to select components in a 2D paradigm like this can be very handy. Once a mesh is laid out and flattened into a 2D form, some faces will be much easier to find and select here than they would be in 3D space if they are in tight spots or covered by other faces.

Shells

A critical idea of UVs is the concept of shells. The shape shown in Fig. 5.1 is one shell. Think of shells as unbroken collections of polygons where each of the shared edges between polygons have been (and this is the metaphor Maya uses too) sewn together.

These shells can be a little difficult to see visually. Two “patches” of polygons can be laying right next to each other with their edges lined up perfectly and still not be a shell. It all depends on whether or not those aligned edges are sewn together.

The power of a shell is that when an individual UV is selected, if the user uses Cntrl-Right-Click-Hold, a Hotbox will appear (Fig. 5.3), that when “To Shell” is selected, the selection will expand out to the edges of a given patch of sewn together UVs. Splitting and sewing these edges together into usable shells is a big part of effective UV planning and manipulation. A shell of UVs will ensure that a texture crawls across that collection of polygons without breaks or seams.

image

FIG 5.3 Cntrl-Right Click-Hold will allow for a single UV selected to expand out to the edge of a collection of UVs that have been sewn together.

UV Maps, Snapshots, and the Purpose for It All

So what’s the point of all this? Why are we worried about UVs, and what will they eventually be used for? Well, consider Fig. 5.4. On the right are the UVs laid out for the complex high-polygon form given as homework in past chapters. All the

image

FIG 5.4 The UV map was used to determine how to paint the texture map.

polygons of the form are represented in that snapshot of the UV space. Beneath it is a painting of the texture to be applied to those polygons (the painting was done in Photoshop). By knowing where the polygons are that represent the collar bones (for instance), the colored texture can be created to allow for shadowing, or changes in color, bump, or specularity. By having the UVs laid out, and a snapshot of those UVs accessible in other applications, we can determine exactly which chunk of texture information goes where on the polygon mesh.

Having good UV maps is the first step for having well-textured objects. Without them, it is impossible to get the texture to go where it needs to be on the form.

The key will be understanding how to manipulate UVs and create them if they don’t exist. There will be some new ideas around the idea of sewing up edges to create new shells, but manipulating UVs will be fairly straight forward (they can be moved, scaled, or rotated in the same way as any other component in Maya). Creating new UVs will be the newest idea.

Projections

The way new UVs are created is through an idea called projections. Although not entirely accurate, an easy way to think about this is as though a texture were being projected onto a surface. This projection will create UVs that are distributed so as to allow a texture to sit across the projected upon polygons.

It turns out there are other sorts of projections where this metaphor breaks down. Cylindrical projections, spherical projections, etc. are much more like wrapping a texture around an object with a blanket; but the core idea of using a projection to create and space UVs to allow a texture to appear undistorted on a surface remains.

Don’t worry, it will make a bit more sense when it is seen in action.

Getting to It

Through years of teaching these seemingly opaque topics, I’ve found that often the easiest way to explain how it works is to simply illustrate the concepts through showing them in action. So without too much other “theory” discussion, let’s get our hands dirty and working through UV layout.

Tutorial 5.1 UV Layout for Architecture and Level Design

It’s a fairly gross generalization to say that all architecture is square. Not every room is a cube — but lots are. Because of this, the architecture of our game level from “Escaping the Madness” will be a great place to get going. Cubes are simple shapes that make the illustration of UV manipulation much easier to see.

image

FIG 5.5 Base room to be UV mapped—the results of earlier tutorials.

Step 1: Open and isolate the room to UV. In the course of this tutorial, we will be UV mapping the results of some earlier tutorials. Namely, the room shown in Fig. 5.5 was created a few chapters ago and will provide several interesting challenges and illustration opportunities. If you have your own version of this room, go ahead and open it, or if you’d prefer to use the exact same assets at the tutorials use, download it at http://www.GettingStartedin3D.com. Look under the Tutorials & Support files in the Chapter 5 thread. The file we’ll be using is called Hallway_Chapter5UV_Start.mb. If you wish to use this one, download it, unzip it, place it within your project file’s scene folder, and then open it in Maya (File > Open).

Step 2: Open and examine the current UV set. Do this by first selecting the wall shape and then opening the UV Texture Editor (Window > UV Texture Editor). It should actually look just like Fig. 5.1.

Why?

This room clearly isn’t a cube — yet the UV layout looks like it is: there are six faces. What you are seeing there is the UVs that existed when this room was first created — as a cube (Maya’s primitives have UVs already created and assigned). If you’ll remember back when we were modeling this room, the new walls were created using some extrude functions. These extrude functions create new geometry — and this new geometry has no UVs. Thus, here, we are about to create UVs for the new polygons we created in the modeling steps and adjust the old UVs that are extant on some of the faces.

Dummy Material

It will be important that we know that the amount of texture space we are assigning to any particular polygon is consistent with the actual size of the polygon. We wouldn’t want a 2-inch chunk of the wall to have as much texture as an 8′ × 8′ chunk of the floor; the biggest objects should have the most texture space (or pixels) to define it.

This can be tricky to find though. One easy way to do this is use a well-distributed texture (like checkerboards) that can be slapped on polygons and as the UVs are created or edited, it will be easy to see whether the checkers on one part of the mesh are bigger or smaller than on others. If the checkers are the same size everywhere on the form, then the relative size of the UVs in texture space matches the relative size of the geometry in 3D space.

So for now, we will create a dummy checkerboard material that we will change out later (in the next chapter).

Step 3: Create a dummy material to illustrate UV space distribution. To do this, right-click on the walls shape and choose Assign New Material.

Step 4: Make the new material a Lambert. When you choose Assign a New Material, a dialog box similar to Fig. 5.6 will appear. We will spend a lot more time working through the details of materials and shader types later. For now, we’ll create the simplest and fastest rendering material type — a Lambert. Just click on the Lambert button.

Step 5: Define a checker pattern for the color attribute of the material. After the last step, the Attribute Editor should automatically pop up and look like Fig. 5.7. At the far end of the Color slider is a little checkerboard square-click this to tell Maya to use an image to define the color. Note that this does not make the color a checkerboard automatically (despite what the button looks like). A new window called the Create Render Node will pop up. Click on the Checkerboard button there.

image

FIG 5.6 Picking the type of new material to create.

image

FIG 5.7 Using the Attribute Editor to use an image to define the color of this new material.

Warnings and Pitfalls

If the Attribute Editor does not automatically fire up, before clicking on anything else, just click on the Show or Hide the Attribute Editor button in the top right corner of the interface.

 

Why?

This actually isn’t an image — it’s a procedural texture. This means it’s a mathematically dynamically created texture. The difference right now is not important, but it’s worthwhile to point out that later we will actually be using images to define the color of a material.

Step 6: Make sure the new material is visible on the wall shape. To do this move the mouse over your persp View Panel and hit 6 (Shaded with Texture) (Fig. 5.8).

image

FIG 5.8 Results of new material with checkerboard as the color.

Why?

There’s a lot to talk about here. First, note that in the UV Texture Editor, this new checkerboard pattern appears in the top right quadrant (which makes the existing UVs a little tough to see (we’ll fix this in a minute). Second, in the View Panel, there seems to be a really weird thing happening in that some of the faces have the checkers on them and some do not. What gives? Well, remember that the original cube had UVs (that are represented in the UV Texture Editor), but the new faces that were extruded did not. Without UVs, Maya does not know how to attach the material to the polygons — so it doesn’t. What you’re seeing there is that the faces that were the original faces of the cube have texture — the new faces don’t. We need to add them.

Automatic Mapping

Anytime software claims to do something “automatically” be afraid — or at least highly skeptical. However, Maya’s Automatic Mapping does indeed have some uses. At its core, Automatic Mapping is the idea of multiple projections being projected onto a surface from many different angles (by default — six — a projection for each face of a cube). This means that for cubic shapes, this can be a very efficient tool (rather than doing six individual projections). For things like square buildings, this can be a very quick way of getting good UVs. For things like our room (with its angled walls), it can be useful for some things but not so great for others.

Step 7: Use Automatic Projection to create UVs for the entire wall object. Do this by selecting the wall object and choosing Polygons|Create UVs > Automatic Mapping (Fig. 5.9).

image

FIG 5.9 Results of Automatic Mapping with the default settings (six projections).

Why?

Take a close look at 5.9 and you’ll see that there are really six light blue/ teal squares that appear to be laid on each side of the form; these are the projections. The manipulator handle has also changed to the kind that allows for Movement, Scale, and Rotation. What this is doing is giving you the option of adjusting the projection here within 3D space. For now, don’t mess with them — we’ll adjust the new UVs in the UV Texture Editor instead.

Notice that what this step did was make sure that all the faces of the wall shape now have checkers on them. This is a good start, although it will definitely have a few problems that we’ll need to solve.

Notice also that in the UV Texture Editor, now the upside down T is gone and has been replaced by a collection of faces that correspond (generally) to the shape of the faces of the room.

There are some problems though — but to see and understand the problems, we’ll need to do a few more adjustments.

Step 8: Dim the texture to make the UVs more visible. Do this in the UV Texture Editor via Image > Dim Image (as can be seen in Fig. 5.9).

Why?

Dimming the image makes the UVs easier to see. With high contrast images like these checkers, it can be tough to see what’s happening otherwise.

Step 9: Resize the checkers to be much smaller across the surface. Do this in the UV Texture Editor. First Right-click-hold and choose UV. Marquee select around all the UVs (all the shapes in the UV Texture Editor at this point). Hit r on the keyboard to swap to the Scale Tool, and scale uniformly in both directions by clicking and dragging on the yellow square in the middle of the manipulator handle. Scale out quite a bit — and well beyond the bounds of the top right quadrant, so that the checkers become much smaller on the wall in the View Panels (Fig. 5.10).

image

FIG 5.10 Resizing the UVs, so that the texture tiles across the surface thus creating much smaller checkers.

Why?

There are actually several ways to make the checkers smaller on the surface of the polygons — but this is my favorite and the fastest. What we are after here is a smaller checker that will allow us to see a few things. First, it will let us see whether the actual size of the checkers is accurate from wall to wall; and second, will let us see whether we do indeed have square checkers. If the size of the checkers from wall to wall matches, we know that the relative size is correct and each wall is getting the correct amount of texture space. If the checkers are square, we know that there isn’t distortion happening in texture space. Conversely, as you can see in the diagonal walls, if the checkers are not square, it means there is distortion, and it needs to be corrected.

Planar Mapping

Flat shapes — like this diagonal wall that has malformed checkers — are perfect candidates for another form of UV Projection — Planar Mapping. This will project UVs straight onto a surface; and although Planar Mapping is a terrible choice for curvilinear forms (like characters), it’s perfect for a flat wall like this.

Step 10: Select the faces of the diagonal wall (Fig. 5.11). Do this in the View Panel.

image

FIG 5.11 Selecting the offending polygons. Notice that they also select in the UV Texture Editor.

Step 11: Use Planar Projection to project the texture anew in a more accurate way. Do this by selecting Polygons|Create UVs > Planar Mapping (Options). In the options window, look for the Fit Project To Area and click on Best Plane. Finally click on Project. The results will appear like Fig. 5.12.

image

FIG 5.12 Results of a Planar Mapping using Best Plane.

Why?

Notice that the Planar Projection options window has the ability to force projection along any one plane (X, Y, Z or Camera); but often for simple forms like this, letting Maya choose the best plane works great and will project flat against the surface.

However, Maya will project in an attempt to maximize texture space, and thus, the results will not be quite ready yet.

Step 12: Resize the new projection to make consistent sized square checkers. Do this in the UV Texture Editor by using the new visible projection manipulator handles to scale the projection (the hollow squares). Scale the projection to get the squares to the right size and make sure they are square (Fig. 5.13).

image

FIG 5.13 Scaling a projection to make square checkers that are the right size, so that the UVs are appropriate for the size and shape of the polygons they are representing.

Why?

The absolute position of this projection doesn’t really matter at this point, although sometimes using the Move handles will allow you to line the projection up to make sure that you have the same number of vertical checkers.

 

Tips and Tricks

Note that there is also a “Keep Image width/height ratio” option within the Planar Map dialog box. This will automatically keep the relative proportions of the projection constant, so the checkers will be square to begin with.

 

image

FIG 5.14 With the projections finished, the inside of the room will make your head hurt. But should show well-distributed UVs via well-distributed and equally sized checkers.

Step 13: Repeat the planar projection process for any other malformed faces. This will probably mean the other diagonal wall and the recessed faces for the windows of those walls (Fig 5.14).

Sewing and Moving and Sewing UV Edges

We are in a good place, but aren’t done yet. Take a look at the UV Texture Editor and things will look a mess. There will likely be lines everywhere and it will be difficult to see which wall is where — and what is a floor, what is a ceiling, and what is a wall (makes it pretty tough to effectively paint a texture).

image

FIG 5.15 Selecting a single edge in the View Panel will highlight that same edge twice in the UV Texture Editor as it is part of two different UV shells.

Additionally, there are going to be seams everywhere. Seams are where one shell doesn’t line up with another. Figure 5.15 illustrates this problem (which you can replicate yourself). Select a corner edge and take a look at what highlights (Fig. 5.15 augments the selection in red for visibilities sake). One edge selected in 3D space highlights two edges in UV space. What really is happening is that the same edge is part of two different UV shells.

The problem here is that the two shells are nowhere near each other. This means that if we were to try and paint the texture, it would be very tough to get a believable corner as the wallpaper, or bullet hole, or dirt we painted on the edge of one shell would be very difficult to line up with the wallpaper, bullet hole, or dirt of another. But if we could make this shared edge a single edge — a part of the same shell — the texture would crawl from one wall to the next seamlessly.

Maya provides some very easy to use tools to make this happen.

Step 14: Move and sew the shells of the diagonal walls together. To do this, select the edge shown in Fig. 5.15 in the View Panel (this will show the edge highlighted twice in the UV Texture Editor). Then, within the UV Texture Editor, choose Polygons > Move and Sew UV Edges (Fig. 5.16).

image

FIG 5.16 Results of a Move and Sew UV Edges.

Why?

So what will happen here is one shell will move up to the location of the other, and the UV edges will be sewn together to make one new larger UV shell.

Step 15: To make things a bit more easily visible, in the UV Texture Editor, select any one UV of the new shell and Cntrl-right-click-hold and choose To Shell to select out the shell and move the shell away, so it’s not in the jumble of other UVs.

Step 16: Repeat for other diagonal wall, so that all the walls that house windows are sewn to one UV shell (Fig. 5.17).

image

FIG 5.17 Single shell for windowed walls.

Step 17: Repeat for two walls on either end of the windowed walls (Fig. 5.18).

image

FIG 5.18 Single shell that includes all the walls but the wall with the doorway.

Why?

Unwrapping a 3D closed shape will always have at least one seam. Part of the challenge of UV layout is deciding where those seams are tolerable. In this case, we want the walls and corners that are visible as the player enters the room to be seamless, so that they make the best impact. For now, we will leave the final wall — the wall with the door — separate. This means that there will be seams at the corners of that wall, but hopefully with some effective texturing, we can minimize the visual impact.

Step 18: If needed, rotate the UV shell for the wall with the door. You may not need to do this, but in my version, the automatic mapping yielded a UV mapping of the wall with the door as a sideways UV set. To fix this, simply select the shell and use the Rotate Selected UVs Counter Clockwise (highlighted in Fig. 5.19) to rotate the wall so it stands straight.

image

FIG 5.19 Rotating a UV shell for ease of painting later.

Step 19: Map and adjust any other faces that need it. This will probably include the relief polygons of the windows. Similarly, give everything a careful look once more to make sure that the checkers are indeed square and the same size everywhere. If they aren’t, in the UV Texture Editor, select offending shells and scale the shell appropriately.

UV Snapshots

Just having UVs laid out is of little value without a good texture. To paint a good texture, we need to know where the UVs are in texture space. To do this, we need to arrange our UVs, so that they all exist within that top right quadrant of the UV Texture Editor, and then create a UV snapshot that will show the shells we have painstakingly made, so that later (in the next chapter) we can paint the texture we want.

Step 20: Scale and move all the UV shells, so that they fit within the top right quadrant. In the UV Texture Editor, marquee select all the UVs. Scale them to fit inside the top right quadrant (the one with the checkers). Our biggest shell is the shell that includes the windowed walls, so use that as a guide. Move the shells, so that they fit within the quadrant (Fig. 5.20).

image

FIG 5.20 Scaled and positioned UV shells.

Why?

Of critical importance here is that we maintain the proportions of each shell in relationship to each other. To do this, always make sure you are scaling all the shells together; that way they can all get smaller, but they get smaller together and one shell doesn’t start getting more or less texture space than it should.

Cut UV Edges

So here’s the problem: The UVs are laid out and they all fit within the top right quadrant. However, there is a lot of that quadrant that is empty; this UV layout isn’t a very efficient use of texture space. What this means in a game situation is that we are paying the price (in video card overhead) for a texture, but only using a bit of its overall space. It’s like buying a Ferrari and then only driving it 20 mph.

image

FIG 5.21 Cutting a UV edge to create two UV shells from one.

To make better use of the texture space, we’ll cut some faces off of existing shells (particularly the windowed wall shell) and recombine those faces elsewhere. This will allow us to resize all the shells larger and make better use of the UV space.

Step 21: Cut a wall away from the windowed wall shell. In the UV Texture Editor, select the edge shown in Fig. 5.21. Choose Polygons > Cut UV Edges. Select the bottom right UV of the far right wall and expand to shell — it will select only the one wall that is its own shell now.

Step 22: Move this new shell (of one wall) away from the shell it used to be a part of.

Step 23: Sew this wall up to the wall with the doorway. To do this select the edge (in the UV Texture Editor) that is shared between the two walls and choose Polygons > Move and Sew UVs (Fig. 5.22).

image

FIG 5.22 Sewing up two other walls.

Tips and Tricks

Sometimes even with a dimmed image, it can be tough to see the UVs. You can hide the texture all together by deactivating Image > Display Image.

Step 24: Scale and move all the UV shells to better fit within the quadrant (Fig. 5.23).

Saving Out UV Snapshot

Now we are finally ready to output the UV snapshot. Part of the technical concern here is determining how big of a snapshot to make. Much of this will depend on the final delivery of this game. If it is going to be on a large PC, we could be working with huge textures. However, if this is destined for an iPhone or Android device, we simply can’t push that many large textures.

Most game engines will allow textures to be downsampled before build. Although this isn’t ideal, it’s acceptable; so for this situation, we will be creating a large 2048 × 2048 texture that we will paint on top of.

image

FIG 5.23 Scaled and positioned shells to make best use of UV space.

Step 25: Export the UV Snapshot. In the View Panel, swap to Object mode and select the walls shape. Back in the UV Texture Editor, select Polygons > UV Snapshot. In the resulting dialog box, be sure to change the File Name to ETM_RoomWest1UVS. Change the Size X and Size Y to 2048. Hit OK (Fig. 5.24).

image

FIG 5.24 Exporting a UV Snapshot.

Why?

Notice that the default path for the output is the images folder of the project file. This isn’t of much use to us now except to remember that that’s where the image is being saved.

By default Maya saves this UV Snapshot out to a Maya .iff file. Recent versions of Photoshop open .iff files fine; but if you are using a very old version of Maya, you may want to change the Image Format to .tiff.

Wrapping Up

The other shapes in this scene (the windows, the window panes, and even the furniture) are also largely squares. Use the techniques we’ve covered so far to UV these shapes as well (Fig. 5.25).

image

FIG 5.25 UV layout complete for the room.

A few notes as you tackle the other shapes:

1. Often, using Automatic Mapping works best with objects that are not rotated in world space. For the furniture pieces, consider rotating them back to square before starting with an Automatic Mapping Projection.

2. Optimize as you go. Through the modeling process — especially for game models — it’s good to delete faces that simply will never be seen. For instance, the polygons at the bottom of the legs are highly unlikely to be seen unless you plan to knock the furniture over. If you discover that this sort of geometry is still around when doing UV layouts, delete them. Often they are taking up valuable texture space.

3. Some highly detailed shapes (like the windows) have a lot of indentions, but these will be mostly covered in grime. Further, when baked, they will likely use an ambient occlusion pass that will further darken these sorts of spaces. Because of this, there is not a whole lot of reason to spend a lot of time unfolding all those UVs. In my version, I just used a planar projection on the entire window.

4. Remember that it’s easier to UV map one object and then duplicate it than it is to re-UV a bunch of identical objects. For the windows, consider UV mapping one, then deleting the versions that aren’t UV mapped, and simply duplicate the mapped one into place.

5. Remember to export UV Snapshots for each object as you go along.

6. The solutions I chose are available on the support site (http://www.GettingStartedIn3D.com/) in the Tutorials& Support Files section.

Conclusion

So there this room is. It’s laid out in all of its checkered glory. Of course there is lots and lots to do here before this space is done — namely texture and lighting and detail geometry (floorboards anyone?); but now, with a good UV layout, we are ready to create the texture assets to make this space come together.

Tutorial 5.2 Organic Form UV Layouts

Architecture is a great way to start to understand the ideas behind UV mapping. But, as in modeling, organic forms present some new and unique challenges. However, the concepts are the same: we’re trying to find ways to unwrap the poly meshes, so that we know where all the polys are and can define exactly how a texture is applied to that surface.

In the previous tutorial, we did a lot of automatic mapping and planar projections. For organic forms, we need to use some sister tools that are much more efficient for the curvilinear shapes of these forms.

For this tutorial, we will be UV mapping the mesh of the alien that we created in Chapter 4. So open that file (Fig. 5.26) and let’s get started.

The Head

We’ll start with the head. With the head, we will get to explore several important ideas surrounding organic forms. First, we will take some time to make sure the head has UVs and then do a sort of rough unwrapping of those UVs. Then, using this rough wrapping, we’ll refine the layout to allow for a better use of UV space to make sure the front of the face gets plenty of texture (as that’s presumably the part of the head we are most interested in).

image

FIG 5.26 The character we modeled before, that we will now UV map.

Step 1: Select the faces that are the head (Fig. 5.27).

image

FIG 5.27 Selecting the faces that are the head. Notice that the selection goes down the neck to where it hits the collar.

Cylindrical Mapping

Step 2: Create a cylindrical projection. Do this by choosing Polygons|Create UVs > Cylindrical Mapping (Fig. 5.28).

image

FIG 5.28 Cylindrical mapping.

Step 3: Open the UV Texture Editor and look at the messy results (Fig. 5.29). Move these newly projected UVs off to the side where they will be easier to work with.

image

FIG 5.29 The faces of the head are UVed; but they are pretty useless as is.

Why?

When Cylindrical Mapping is selected, a sort of half cylinder will appear across the front of the face. This is the projection manipulator handles. For now, we don’t need to mess with them (we will for later projections though). The idea for now is we want to make sure that all of the faces of the head do indeed have UVs. This first cylindrical projection does this and makes a rough stab at how the UVs would work around the side of the head.

Step 4: Separate the mouth as a separate UV shell. The easiest way to do this is double-click on an edge at the front of the oral cavity that is just inside the lips (Fig. 5.30). This will select a ring of edges. In the UV Texture Editor, choose Polygons > Cut UV Edges.

image

FIG 5.30 Selecting a ring of edges to Cut UV Edges along that will separate the mouth from the head.

Why?

Separating the mouth from the head gives us some additional seams that we’ll need as we attempt to smooth the UVs out in the coming steps.

Smooth UVs

The Smooth UVs Tool is a relatively recent addition to Maya but is so useful in organic shape UV layouts. It actually has several parts to it; the most interesting for us right now though is the Unfold function of it. What it will allow us to do is unfold this jumble of UVs that we currently have. The Smooth UVs Tool is most easily accessed within the UV Texture Editor as shown in Fig. 5.31.

image

FIG 5.31 Selecting the Smooth UVs tool from the UV Texture Editor.

Step 5: Unfold the UVs of the head. Do this by selecting any one UV of the head in the UV Texture Editor and then expanding to its shell. Next activate the Smooth UVs Tool and watch for two little yellow boxes with the words Unfold and Relax in them. Click and drag to the right on the word Unfold and watch as the UVs unfold, so that all the faces become visible (Fig. 5.32).

image

FIG 5.32 Unfolding a shell using the Smooth UVs Unfold function.

Warnings and Pitfalls

Depending on the topology of your project, you may end up seeing strange flaps sticking out of your shape (as can be seen in Fig. 5.32 on the right side). If this happens, just use Move and Sew UV Edges to get them back into place.

Step 6: Repeat for the oral cavity. Do this by first selecting the faces that are the oral cavity (probably most easily done in the View Panel) and then in the UV Texture Editor Cntrl-right-click and select To UV to convert the selection from a group of faces to UVs. Then (still in the UV Texture Editor) move this collection of UVs away so they can more easily be worked with. Use the same Smooth UVs Unfold functionality to unfold the faces.

Why?

Don’t get too worked up over the oral cavity. It’s unlikely we will see much of this shape, so working with the oral cavity at all is just about making sure those polygons and UVs are accounted for.

Step 7: Use Automatic Mapping and Sew UVs to create and assemble UVs for the antennae. Do this by first selecting the faces that are the antennae. Choose Polygons|Create UVs > Automatic Mapping. In the UV Texture Editor, move this new projection down away from the other UVs so they can easily be worked with. Next, start selecting edges and using Move and Sew UV Edges to reassemble the shells together (Fig. 5.33).

image

FIG 5.33 Selecting faces (far left). The results of Automatic Mapping (center) and finally reassembling with Move and Sew UV Edges (right).

Why?

The idea here is to use UV mapping to get several projections going on those antennae, so that all the UV faces are laid out flat. Then, reassembling with Move and Sew UV Edges gets it back to a near seamless state (there will be one seam for sure). At the end of this process, you will have imperfect UV shells (there are overlapping UVs for instance that we’ll work out in a minute); but these new shells are much more accurate than they were when they were part of the big head shell.

Warnings and Pitfalls

Make sure that as you are Move and Sewing UV Edges, that you do not re-sew the antennae back onto the head. As you select each edge, make sure you know where the other edge shows up at — and if it’s back up on the head, don’t sew it. Instead select another and sew, so that the antennae remain independent of the head.

Step 8: Use the Smooth UVs Tool’s Unfold option to unfold these antennae into a better shell (Fig. 5.34).

image

FIG 5.34 Unfolding (via Smooth UVs) the antenna shells.

Refining the Face Region

We’ve got a good start, but by unfolding the entire head at once, the region of the face very easily becomes scrunched up together as Maya attempts to fit all the UVs of the whole head into one shell. Sometimes, taking an unwrapped shell like this and unfolding certain sections will allow for a better distribution of UVs and allow for less deformed texture across key areas like a character’s face.

Step 9: Select just the faces (polygons) of the character’s face. A nice way to do this is to select all the faces of the head in the UV Texture Editor, and then in the View Panel, Cntrl-marquee across the polygons that are not desired (the back of the head) as seen in Fig. 5.35.

Step 10: Re-project the UVs for these faces using Polygons|Create UVs > Cylindrical Mapping.

image

FIG 5.35 Using the UV Texture Editor in concert with the View Panel can allow for rapid selection of appropriate faces.

Why?

I know, we’ve already projected these polygons with a cylindrical map. The difference here is that we are creating a cylindrical projection for just the face this time (not the whole head). This will give us a smaller and cleaner shell that will unfold more cleanly.

Step 11: Clean up the new projection. Watch for strange flaps that this projection may cause. Additionally watch for areas like down the front of the neck that may end up split. Figure 5.36 shows a selection of edges that are all to be sewn together (Polygons > Move and Sew UV Edges) to create a unified UV shell.

image

FIG 5.36 Cleaning up the results of the cylindrical projection.

Step 12: Unfold — via Smooth UVs — this new face UV shell (Fig. 5.37).

image

FIG 5.37 Using the Smooth UVs Tool’s Unfold function to further refine the face UV shell.

Step 13: Create a new shell as a strip to represent the top and middle of the back of the head. We’ll get this off of the old projections. Figure 5.38

image

FIG 5.38 Creating a new shell to represent the top and back of the head.

Why?

The idea here is to try and make sure our seams are not across the middle of the back of the head. In this case, we have those ridges that make for a good seam location. Getting the center top and back of the head into one strip as a UV shell will ensure that the texture still holds up well when we see the back of the character (which could be often in a third person game).

(left) shows the edges that need to be selected and then cut (Polygons > Cut UV Edges). Next, select the outer edges (Fig. 5.38, center) and Move and Sew UV Edges to make a new shell. Finally, Fig. 5.38 (right) shows this new shell after using the Smooth UVs Tool’s Unfold functionality. Step 14: Scale this new shell, so that it matches the top of the face shell and attach them together with Move and Sew UV Edges (Fig. 5.39).

image

FIG 5.39 Face shell that now includes the shell that was the top and back of the head.

Step 15: Reattach the remaining head shells. To do this select the remaining shells of the side of the head and scale them, so that their edges are similar in size to the extant face shell. Then attach them to the face shell with Move and Sew UV Edges (Fig. 5.40).

Step 16: Take one more pass at Smoothing the UVs (with the Unfold).

Step 17: Finally, scale and position the antennae and oral cavity shells. For now, just eyeball them in scale, but rotate them around so they make

image

FIG 5.40 Finishing up the head by reattaching remaining UVs.

Tips and Tricks

Notice that the selection shown in Fig. 5.40 (left) is pretty liberal (it’s not limited to just the edges that are to be sewn together). This is OK actually as the other edges that are selected there are already sewn together; so they will have no effect on the final shell once Move and Sew UV Edges is used. Sometimes a sloppy selection like this can save a lot of time and yield the same results as if a very careful selection of edges were made.

sense to you (as you’re going to be painting this stuff later). Notice that the oral cavity in Fig. 5.41 is stuck inside the empty space of the character’s left eye.

Step 18: Create a checkered Lambert for the character. As we did in the last tutorial, in the View Panel, right-click-hold on the character and choose Assign New Material. Create a Lambert, and then in the Attribute

image

FIG 5.41 Bringing the other head parts together. Notice they are not sewn together but are placed where they will be easy to identify.

Editor, click the checker button next to the Color channel and choose Checker.

Half the Work, Twice the Results

Notice that for the next big collection of steps, we will only be working on one side of the alien (his left side). Because this creature is symmetrical, it will allow us to UV once and then duplicate the UVed side. What this will also allow us to do is overlap some UVs (so both hands exist in the same UV space — just mirrored versions on top of each other), so that we are able to use more of the texture space on the forms.

Armor Pieces

The armor pieces are unique shapes that could be tackled in a lot of different ways. But a quick and easy method for smaller elements like this is the method where UVs are created with Automatic Mapping, and then the exploded shells reassembled.

Step 19: Select the faces that are the shoulder pads and the belt buckle.

Step 20: Polygons | Create UVs > Automatic Mapping (Fig. 5.42). Move this new projection to a good place to work with them within the UV Texture Editor.

image

FIG 5.42 Results of Automatic Mapping. Now we can put it all back together.

Step 21: Assemble and unfold. Use the Move and Sew UV Edges to reassemble the armor parts. Remember not to sew the edges of the armor back onto the body. When the pieces are all assembled again, use the Unfold function of the Smooth UVs Tool to unfold the shells (Fig. 5.43).

image

FIG 5.43 Assembled and unfolded armor shells.

The Belt and More Cylindrical Mapping

We have used Cylindrical Mapping to quickly create some UVs for the face. But this tool can be used for more accurate mapping as well. Specifically, we can make sure that the projection wraps clear around a cylindrical object (like the belt).

Step 22: In the View Panels, select the faces that are the belt.

Step 23: Choose Polygons|Create UVs > Cylindrical Mapping. Although this projection is still active, activate the Channels Box and change the Projection Horizontal Sweep to 360 (Fig. 5.44).

image

FIG 5.44 Adjusting the Cylindrical Mapping projection to wrap clear around the object.

Step 24: In the UV Texture Editor, move this new projection out to a place to work with it and use the Smooth UVs Unfold to unfold the projection.

Step 25: Repeat this process for the cummerbund part of the belt. Select the polygons and use Cylindrical Mapping with a 360 Projection Horizontal Sweep to create the UVs for the area. Then Unfold with the Smooth UVs Tool (Fig. 5.45).

image

FIG 5.45 Creating the shell for the top of the belt — the cummerbund area.

Cylindrical Mapping Revisited

We’ve made extensive use of Cylindrical Mapping, but haven’t yet really made extensive use of some graphical manipulations of these sorts of projections. When Cylindrical Mappings are first activated, there are some manipulators that appear in the View Panel that can be used to visually adjust how that projection is applied to the selected polygons. Unfortunately these manipulator handles can be very tough to see on your own screen, even tougher to see in print, and almost impossible to discern when there is a high contrast checkerboard material beneath it. So, consider Fig. 5.46 where we’ll try and break down how these handles work.

image

FIG 5.46 Using the manipulator handles of the Cylindrical Mapping Tool to create a projection that is closer to the orientation of a diagonal collection of polygons.

In Fig. 5.46 (left), you can see the manipulators as they appear immediately after Polygons|Create UVs > Cylindrical Mapping. On the far left, a small red T is highlighted. When this is clicked, the manipulator handles will turn into the traditional manipulator handles that show the projection can be moved, scaled, or rotated. This is important as the default position of a cylindrical projection is straight up and down — but sometimes the polygons, the projection is meant to map, are diagonal. Once this T is clicked, the projection can be rotated (as it is in the next two shots) to align with the rotation of the polygons it is mapping. When the T is clicked again, new handles appear that allow the projections Projection Horizontal Sweep settings to be manually adjusted (in this case, wrapped completely around the shape, 360°).

Being able to manually control the projection becomes all sorts of important for things like arms, legs, or other collections of polygons in those sorts of areas.

Step 26: Use this new understanding of the Cylindrical Mapping Tool for areas like wrist armor (Fig. 5.47). Remember to select the faces, activate the projection with Polygons|Create UVs > Cylindrical Mapping, and then use the manipulator handles to rotate the projection into place to effectively wrap the shape. Don’t forget to use the Smooth UVs Unfold Tool.

image

FIG 5.47 Using Cylindrical Mapping to effectively wrap the wrist armor.

Step 27: Repeat for shapes like the arms, legs, and chest (Fig. 5.48).

image

FIG 5.48 Mapping the arms or legs.

The Boot

Ah feet. Always and interesting challenge. You actually already know of the tools needed for this though. Not to fear.

Step 28: UV Map the boot. Do this with three projections: two cylindrical (Fig. 5.49, left and center) and one planar (Fig. 5.49, right).

Chests, Backs, and Planar Mapping

There are a few other areas where a quick Planar Mapping will do just the trick. These have to be done with caution as they are a seductive way to get UVs quick, but the results can quickly be very distorted. However, there are some shapes (like the chest plate and the armor on the alien’s back) where a quick planar map will be perfect.

image

FIG 5.49 Mapping the boot.

Step 26: Select the faces of the chest plate and use Polygons|Create UVs > Planar Mapping (Options). Be sure that Best Plane is checked for the Fit Projection To setting and hit Project. In the UV Texture Editor, move the new projection to a new place and use the Unfold of the Smooth UVs Tool (Fig. 5.50).

image

FIG 5.50 Working through the breast plate with a quick planar projection.

Step 27: Repeat for the back armor (Fig. 5.51).

Hands

The hands can be overly complicated. My personal favorite technique is to do the hands with just a couple of Planar Projects and then make heavy use of the Smooth UVs Unfold functionality.

Step 29: UV Map the hands. Do this by selecting the faces of the hand that are the palm and Planar Map them. Then do the same for the top of the hand. Be sure both of these projections are in a good place to see them in the UV Texture Editor and use the Smooth UVs Unfold to unfold them into a usable shell (Fig. 5.52).

image

FIG 5.51 Back armor using planar mapping.

image

FIG 5.52 Mapping the hands with two planar projections.

Misc. Cleanup

Step 30: Make sure all of one half of the alien is mapped. At this point, you will likely have loads of shells scattered hither and yon throughout your UV Texture Editor. The nice thing about this is that the top right quadrant will have any faces that have not been mapped yet.

Step 31: Scale your shells, so that the checkers are the same size everywhere — except for the head — it can be bigger than the rest.

Why?

The head will be very important to the visual impact of the character. Because of this, a common technique in gaming is to cheat the head UVs and allow them to be bigger than usual, so that they take up more texture space — and thus, the texture is sharper across the face (which is the first place we look at a character).

Mirroring

Now that we have half of the mesh UVed; we can duplicate this finished side and not have to manually re-UV the entire other half.

Step 32: Select all the faces on the right side of the character and delete them (Fig. 5.53).

image

FIG 5.53 Deleting the right side of the character (the non-UVed side).

Step 33: With one half of the character selected, choose Polygons|Mesh > Mirror Geometry (Options). Change the Mirror Direction to be -X and click mirror (Fig. 5.54).

Step 34: Flip the head shell. To do this, in the View Panel, select any one UV on the head. Then in the UV Texture Editor, expand this one UV to the shell (which should show up right on top of the one half of the head shell).

image

FIG 5.54 Mirrored mesh — notice that the checkers are all mirrored as well.

Why?

Take a look in the UV Texture Editor. Go to Image > Shade UVs. The way this tool works is UV faces that are facing forward (the direction of the face normal) will show up blue. Those facing away will display as pink. For now all of the shells will show up a dark purple (blue on top of pink). What this means is that the Mirror Geometry left the UVs right where they were but are mirrored (and thus facing the opposite direction of the originals. In some cases, this is fine; we want it to be that way for things like the arms, boots, and hands where we will be happy to pick up that extra texture space). But in other places (like the chest plate that goes across the middle of the chest and the head), a mirrored texture would look very strange. In places like that, we want to be sure and make those UVs not laying on top of each other, but mirrored and facing the right way.

Use the Move Tool to move the shell away from the other (it will be pink). Next choose Polygons > Flip (Options). Make sure the Direction is set to Horizontal and hit the Apply and Close button.

Why?

This will flip the shell, so that it is the mirrored version of what it was. It will turn blue as it is now facing forward.

Step 35: Maneuver this new shell, so that it aligns with the shell of the left side of the face (Fig. 5.55).

Step 36: Select all of the edges right along the center of the mirrored axis and choose Polygons > Move and Sew UV Edges to seal the two sides into one shell.

image

FIG 5.55 Maneuvering the right side shell into position.

Step 37: Repeat this process for any place where a mirrored texture would be obvious. This would include the belt, the cummerbund, the chest plate, back plate, and crotch (Fig. 5.56).

Scale and Organize

Step 38: Scale the head shell, so that it fills a quadrant vertically (be sure to scale in all directions at once).

Why?

Remember we are going to allow the head to have a lot of texture space. Because it’s the biggest, positioning it first will help in the organization puzzle that is to come.

Warnings and Pitfalls

Now that we’ve spent all this time creating well-built UV shells, it is critical that when scaling shells that you always use the middle yellow box to scale in X and Y together.

 

image

FIG 5.56 Mirrored UV shells for belt, cummerbund, breast plate, and back plate. Notice that this also cut the belt and cummerbunds into two strips to allow for easier organization of shells.

Step 39: Scale all the other shells at once and begin to maneuver them into place around the head. If you find that the shells won’t fit, select them all and scale them all at the same time to maintain the relative size to each other (Fig. 5.57).

Warnings and Pitfalls

Be sure all of the shells fit within the top right quadrant. Be careful that the mirrored versions stay together but that these UV shells do not overlap any other shells.

Step 40: Delete all your history (Edit > Delete All by Type > History).

Why?

Along the way you will have amassed an amazing amount of history in the form of projections. Deleting the history will keep your scene clean.

 

image

FIG 5.57 Assembling the puzzle that is the UV set up for the alien.

Step 41: Make a UV Snapshot of the alien’s UV layout. You might name it something like AlienUVSnapshot.

Conclusion

Pretty intense, eh? This sort of task seems pretty thankless at first. All you have left after hours of work is a weird checkered alien that doesn’t appear all that different than what the alien looked like when you started. But, under the hood, you’ve got the UV layout that is going to allow for sophisticated texture painting.

What’s Next

Well now that we have UV maps created for the game level and our character, we can get going on creating the textures that will finally get us out of this grey plastic (or checkerboard) hell. Yay!

In the next chapter, we will start painting textures to bring the surfaces to life. The most fun is yet to come!

Homework

1. Layout the UVs for the rest of the game level.

2. Layout the UVs for the high-rez challenge from the last chapters.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset