You can do it later, but if you areusing a biped skeleton, and the Skin modifier is already added, make sure that thebiped is in Figure mode; otherwise, when you select faces on the mode
Trang 2• Unwrapping the Body with a Normal Map
• Unwrapping the Character’s Face
• Creating a Character UV Template
• Unwrapping the Helmet
• Unwrapping a Component Mesh
• Unwrapping with Multiple Materials IDs
• Saving, Loading, and Combining UVs
• Baking the Texture into the Mesh
Trang 3UNWRAPPING ACHARACTER—OVERVIEW
Unwrapping a character is more difficult than unwrapping weapons and pickups cause the mesh is more organic Setting up the UVs properly in the Edit UVWs dia-log box can be like putting together a complex 3D puzzle where the shapes keepchanging If you have worked through Chapter 3, “Unwrapping Game Art,” and youare patient, you should see promising results with a few hours’ work If you areusing your own mesh, try to keep it simple the first time through
be-Unwrapping Before You Rig the Model
Unwrapping is best done before rigging your model You can do it later, but if you areusing a biped skeleton, and the Skin modifier is already added, make sure that thebiped is in Figure mode; otherwise, when you select faces on the model, they may beslightly offset due to minor adjustments in bone position when you switch out of Fig-ure mode You can also make a copy of the entire character mesh from the riggedcharacter (again, while the biped is in Figure mode) and delete the Skin modifierfrom the copy You can then unwrap this copied version of the mesh; its UVs aresaved and applied to the actual character As long as the number of vertices stays thesame, the UVs should transfer from mesh to mesh without difficulty If you see greenlines in any of your UVs that come from an overhang or from polygons that face thewrong direction, it’s likely you have found some stray vertices in your mesh
Understanding the Impact of Stray Vertices
Any stray vertices in your model at this stage of the game cause issues in your wrapping process You don’t want to get nearly finished with the unwrap and findthat you have to weld some vertices together Changing the vertex count on yourEditable Mesh can cost you some of the work you have done in the Edit UVWs dia-log box unless you detach the problem area before fixing it and then reattach to the main body Figure 8.1 shows a before and after image; the image on the left isthe completely unwrapped character with carefully placed UVs in the texture area,and the image on the right is what the texture and UVs can look like after any ver-tices are welded, or if any parts of the mesh are detached Depending on how muchyour model is changed, you can lose all of the UV work you have done Clicking theUndo button does not fix this problem Hold off on positioning your UVs in thetexture area until you are sure the model is what you want In most cases, you canrescale and reposition these UVs by bringing in the finished texture as the new back-ground and adjusting the UVs until they fit the saved texture file
un-Removing Stray Vertices
If you are not sure whether you have stray vertices or not, one technique is to selectall the vertices in the Editable Mesh, and from the Edit Geometry rollout, in theWeld group, click the Selected button This operation is easier to do with an Editable
Trang 4Chapter 8 Character Unwrapping 191
Poly, because the Threshold Weld dialog box gives vertex count feedback As long asyou set the threshold value correctly, this process should weld any stray vertices For
a hand on a 2.5-meter character, a weld threshold of 0.01 meters should work well.You can also try rotating the model and moving vertices to see if they are not prop-erly welded; in addition, visually inspect the model after any threshold weld process
to make sure you did not weld too many vertices together The smallest areas of themesh are most prone to being welded inadvertently If you perform a threshold weldwhile zoomed in on small detail areas like the lips or fingers, when you see thesesmaller features begin to weld together, you know it’s time to increase the weldthreshold value
UNWRAPPING THEHANDS WITH APLANARMAP ANDADDINGTHEM TO THEBODY
Hands can be difficult to unwrap, particularly if they are already in a bent position
Of course, you can do this while the hands are attached to the body, but here wewant to demonstrate how you can detach parts of your character mesh during theunwrap process One reason for doing this is that it is time consuming to unwrap ahand, and it’s not necessary to do it twice; by unwrapping one hand, you can thenmirror it to the other side and reattach it to the body Another reason for detachingthe hand might be that you need to make some modeling changes, and you want to
FIGURE 8.1 Changing the vertex count on the mesh affects your UVs.
Trang 5work on it without being tied to the entire body; again, if you fix one hand, you maywant to just mirror it to generate the other hand If the hands need to have differentfinger positions, it might still make sense to develop one good core hand and thenadjust the fingers on the other hand as necessary
In Figure 8.2, both hands were detached from the body, and the right hand wasdeleted The left hand had the Unwrap UVW modifier applied, and Planar mapswere used to capture the back of the hand, which was then moved out of the textur-ing area This process is similar to what we used to unwrap the power charger inChapter 3 Select the faces, turn on the Planar button, select Best Align, and thenturn off the Planar button so that you can move the newly created UVs out of thetexture area and go to the next set of faces
FIGURE 8.2 The back of the hand is planar mapped and moved aside.
When you’re done with the back of the hand, you can unwrap the back of thefingers, the palm, and the sides of the hand (see Figure 8.3) Select as many faces asyou can that are roughly in the same plane, repeating the process you used for theback of the hand until you’ve unwrapped all of the high-visibility areas The differ-ent portions of the hand can be broken off and oriented to create one big hand, laidout flat, and centered on the area of the little finger Some scaling and mirroring arenecessary during this process The areas between the fingers can be overlapped tosave texture space; they will receive a generic texture
All possible edges were stitched together to give as much continuity as possible
to the texture Figure 8.4 shows a screen shot of the finished UVs for the hand andthe texture on the character Remember that if you cannot stitch an edge, you may
be able to weld a vertex Both options are available from the right-click menu aslong as you are in the correct sub-object mode You should be in Edge sub-object
Trang 6Chapter 8 Character Unwrapping 193
mode to stitch edges together, and you should be in Vertex sub-object mode to weldvertices Review Chapter 3 if you are not sure how to perform planar unwraps andstitch/weld UVs
When you’ve unwrapped this hand, use the Mirror tool (located in the Standardtoolbar) to mirror the hand around X to make the right hand (see Figure 8.5) If youhave not moved the right hand from its position, you only have to worry about thepositioning of the mirrored hand This figure shows the Mirror tool in action; you arelooking at the back viewport, at the front side of the character, and mirroring a copy of
FIGURE 8.3 The parts of the hand are unwrapped and placed in position for stitching.
FIGURE 8.4 Both sides of the hand are stitched together at the little finger.
Trang 7FIGURE 8.5 The mirror tool allows you to mirror around any axis or plane.
the left hand around the X axis If you cannot get the hand positioned well enough withthe Offset value on this dialog box, you can always move the hand after clicking OK.Now that you’ve unwrapped the hands, how do you reattach them to the body?First make sure to save the UVs Select the body mesh, and attach both hands to thebody Then weld the vertices in the wrist area together using an implied windowand the Threshold Weld tool Add an Unwrap UVW modifier to the body mesh, clickthe Edit button, and you should see the UVs for the left hand exactly where youplaced them, with those of the right hand perfectly overlaying them The rest of thebody mesh UVs should be in the texture area
UNWRAPPING THEBODY WITH ANORMALMAP
This example involves unwrapping the astronaut using the Normal map method.This is the same method we used to unwrap the weapon, and it is by far the moststraightforward way to get a character ready for texturing, particularly if the charac-ter has a clearly distinguished front and back Because we created the astronautmesh by starting with a box and using the Symmetry modifier, we ended up with apretty good seam that divides the front and the back faces of the body of the mesh.See Figure 8.6 to note the seam and the front/back faces
Make sure your character mesh is an Editable Mesh and that Symmetry and anyother modifiers are collapsed Just as in Chapter 3, add the Unwrap UVW modifier tothe mesh and click the Edit button This opens the Edit UVWs dialog box Resize andmove the dialog box until you can see the tools at the bottom Turn off the map dis-play as well as the grid markers to simplify the display Get into Face sub-objectmode, and if there are any body parts (such as hands) that have already been un-wrapped, move them aside Next, select all the remaining faces, and go to Mapping,
Trang 8Chapter 8 Character Unwrapping 195
FIGURE 8.6 A Normal map is applied to the front and back of the character.
Normal Mapping Select Front/Back, and uncheck the Rotate option This shouldgive you a front and back view of the character mesh
Breaking and Overlapping UVs
Select the head in the front set of UVs and right-click Break Move the head awayfrom the rest of the body Do the same with the back set of UVs If the hands havenot already been set aside, do this now by breaking them off the front and back UVsand moving them out of the texture area Now your astronaut body should be with-out a head or hands The challenge now is to find places where you can overlap UVs
to save on texture space Overlapping also simplifies your texturing work Someareas are obvious candidates for overlapping, such as the front of both legs and the back
of both legs A trickier area is the front and back of the torso Because the geometryand edge flow differs significantly from front to back, overlapping does not work aswell here; however, you can still do it, depending on the texture When you areoverlaying UVs, make sure to zoom in to place them as precisely as possible
Breaking and Reorganizing UVs
Depending on your model, some of your UVs may end up in the wrong place Thiscan happen if the seam along the sides of the mesh is not consistent; if some of thefaces on the front side of the mesh actually face the back of the mesh, they will end
up with the backside UVs If there are overhangs, such as at the character’s chin,these faces may end up with the backside UVs You can select these faces from theEdit UVWs dialog box or from the viewport, and you can break them off and re-attach them where they belong by stitching edges or welding vertices
Trang 9In Figure 8.7, two triangles on the back of the character’s neck have been signed to the front of the body because they were actually facing the front You canselect these, break them off, move them to the backside UVs, and stitch/weld theminto place The green lines in this image underneath the eyes indicate a detachedvertex in the model To fix this, you can detach the head mesh, repair it by weldingthe vertex, and reattach it to the main body of the character
as-FIGURE 8.7 Selecting a polygon from the front UVs, which belongs on the back UVs.
Adjusting the UVs on the Body
You can now adjust the vertices of the astronaut UVs so that the streaking on thesides of the body is corrected First, create a checker material and apply it to themesh Adjust your viewport view and the Edit UVWs dialog box so that you can seeboth at the same time Because the front and back UVs of the mesh have been over-laid, make sure that you window the vertices as you select them, or you will not beselecting both of them If your computer can handle it, make sure Options, Ad-vanced Options, Constant Update in Viewports is checked on; that way you can seethe effect each vertex move has on the texture in the viewport
Figure 8.8 shows the process of selecting the vertices on the right side of thetorso front and moving them to the left to widen the UVs and cause a more orderedchecker pattern on the model When you are using Planar or Normal mapping,every face on the model that is not very nearly flat to the plane needs some kind ofadjustment; the more skewed faces need the most adjustment
Trang 10Chapter 8 Character Unwrapping 197
FIGURE 8.8 Selecting and moving a column of vertices to fix the side streaking.
UNWRAPPING THECHARACTER’SFACE
You can unwrap the head with a Normal map, a Planar map, or a Cylindrical map.Each of these options has its pros and cons The Planar map behaves pretty much thesame as a Normal map, depending on which way the head is tilted; because the Nor-mal map projects to the existing orthographic views, if the character is lookingstraight on, you usually get a pretty good approximation of the character’s features.Planar mapping has the additional ability to do a Best Align for the selected faces,which could generate more accurate UVs than a stock Normal map What is usefulwith a Planar map is the idea that the face you are UV mapping will look recogniz-able from the front A Cylindrical map, on the other hand, tends to distort the facialfeatures and might make it harder to texture, even though the cylindrical shapemight be more suitable for the shape of the head overall
Adjusting the UVs on the Face
After you’ve applied the facial texture to the model, obvious problems become ent; Figure 8.9 gives an example of this Notice in the upper-left image that the areanear the tear duct is distorted Now look at the image at the upper right and you cansee the problem; the checkered test pattern is wavering heavily in that area The two
Trang 11appar-images in the lower half of Figure 8.9 show how moving a few vertices so that thecheckered pattern is more ordered also makes for a better, more finished texture
FIGURE 8.9 You can improve the UVs around the eye by moving a few UV
vertices.
Unwrapping with the Pelt Map
The Pelt map is a feature that is available to those who have version 7 or later of 3dsMax This feature automates much of what is normally done by hand; if you unwrapthe front side of a 3D object, there are generally points along the edges where youhave to pull out the vertices so that the UVs can “catch” the texture and avoidstreaking along the sides The Pelt map looks like a device used to stretch out thepelts of skinned animals Each vertex on the “stretcher” pulls with a spring tension
on the outermost vertices and is dampened toward the inside In a sense, this actslike a soft select
To use the Pelt map, launch the Unwrap UVWs modifier Start by clicking theEdit button and selecting the faces you want to unwrap Then click Pelt from theMap Parameters rollout, and select an alignment option from the buttons immedi-ately below (such as Best Align) Finally, click the Edit Pelt Map button to get to thepoint shown in Figure 8.10
Figure 8.11 shows what happens to the vertices as well as the textured modelwhen you click the Relax (Light) button a few times The vertices at the borders ofthe map are pulled on and expanded; this generally improves the overall UVs, al-though it may still be necessary to move some of the vertices by hand
Trang 12Chapter 8 Character Unwrapping 199
FIGURE 8.10 After you’ve selected the UVs, click Pelt, Best Align, Edit Pelt Map.
FIGURE 8.11 The Pelt map improves UVs with a few clicks of a button.
Trang 13CREATING ACHARACTERUV TEMPLATE
After you’ve created the UVs, you need to scale and position them for maximumeffect in the game Prioritize what is most important visually and scale those UVsbigger; for instance, the face and hands of the character demand more detail thanthe legs and arms (see Figure 8.12) In some cases, it helps to have certain UVs next
to each other to make the texturing task easier; because our character will be ing a ribbed spacesuit, it will be helpful for the leg UVs to be next to each other sothe ribs can stay lined up An option here is to create a vertical seam along the edges
wear-so that the horizontal ribs do not have to blend perfectly The circular UVs in thecenter of the texture area are for the neck area, which the helmet rests upon; theseUVs were generated from the top view All UVs should be right-side up if possible
so that they are in the orientation you are used to looking at them in; this makestexturing them more natural It can also be helpful if you scale those UVs that arereceiving the same texture the same amount, so that less adjustment is necessary inthe texturing process Try to leave as little blank space in the texture area as possible Just as you did in Chapter 3, in the Edit UVWs dialog box, select Tools, UVW Tem-plate to generate a UV template and export it as a bitmap Because this is a character,you can set the size to 512 × 512, the biggest possible texture size allowable by theTorque Game Engine The unwrapped astronaut mesh is named AstronautMesh.max
and is available in Files\Astronauton the companion CD-ROM
ON THE CD
FIGURE 8.12 The finished UV template.
Trang 14Chapter 8 Character Unwrapping 201
UNWRAPPING THEHELMET
Figure 8.13 shows the helmet unwrapped; this was done with Planar, Best Align,selecting nearly coplanar sections of the helmet one at a time and then stitchingthem together for continuity in the texturing process The ear and mouthpiece areaswere separated, but all outside-facing UVs were given as much texture space aspossible The UVs for the edges and inside faces were scaled down and overlapped,reflecting their lower priority in regard to visibility and impact on the texture Theunwrapped helmet texture is included in the file AstronautMesh.maxand is available
on the companion CD-ROM under Files\Astronaut
ON THE CD
FIGURE 8.13 The helmet can be unwrapped with Planar, Best Align and then stitched together.
UNWRAPPING ACOMPONENTMESH
The robot in Figure 8.14 is unique in that it was built from components that were tached at the end This process automatically created a different element for each ofthe components within the Editable Mesh Each portion of the mesh can be added tothe Edit UVWs texture area by using the Select by Element option of the UnwrapUVWs modifier In this case, the element was then broken into planar sections usingPlanar mapping A Planar map is particularly important for the faces of this modelbecause there are round elements such as rivets and rivet patterns that would be-come oblong with anything less than a perfectly flat Planar map
Trang 15at-UNWRAPPING WITHMULTIPLEMATERIALIDS
You can apply this method to your pickups or to characters; you set up a Multi/Sub-Object material that allows you to change the color and material ID of selectedfaces so that you can easily manipulate different selection sets from within the EditUVs dialog box
Creating a Multi/Sub-Object Material
The first step in this process is to create a Multi/Sub-Object material You do this byclicking on a new material sample slot and then clicking the Standard button, whichtakes you to the Material/Map Browser (see Figure 8.15) Set Browse From to New
In the list, double-click the Multi/Sub-Object selection; this should change yourMaterial Editor interface so that you can set the number of materials you want andassign colors to them (Names are not necessary but can be helpful in keeping track
of your polygons.) Assign this material to your model, and make sure Show Map inViewport is turned on
Assigning Mesh IDs to Polygons
Next, assign each relatively flat portion of the model to a Mesh ID In this example,the front and back of the head, torso, legs, arms, and collar area are assigned sepa-rate IDs, names, and colors The arms and feet of this model have been left off for
FIGURE 8.14 When a mesh is created from components, use Select by Element.