Preparing Polygons
Although NuRBs surfaces are ready to render with their default uvs, polygon surfaces often need a great deal of adjustment. The use of primitives is the exception since the primitive's inherent uvs are orderly. As soon as various polygon modeling tools are applied to a primitive, however, the resulting uv texture space is cluttered and unusable (see Figure 9.8).
Figure 9.8 A polygon cylinder's default UV texture space and the result of numerous modeling tools
Figure 9.8 A polygon cylinder's default UV texture space and the result of numerous modeling tools
There are two main approaches to preparing uvs within Maya: pelt mapping and mapping tools. pelt mapping generally requires a specialized Mel script, but can be achieved with standard uv tools through the uv Texture Editor. mapping tools, on the other hand, are built into the program and represent the most common method of uv preparation.
Pelt Mapping
Pelt mapping unwraps geometry as if it were the pelt or skin of an animal. The goal with this approach is to create a single, large UV shell for the entire surface. This simplifies the texturing process by minimizing the number of resulting edges. In addition, the pelt mapping process creates a UV point distribution that mimics the original mesh. That is, the distance between each point is equivalent to the distance between matching vertices.
Several MEL scripts automate the creation of pelt mapping. For example, pelt.mel, available at http://highend3d.com, operates in the following manner:
- Creates a duplicate of the target surface.
- Allows you to define seams on the duplicate by cutting edges.
- Creates control clusters for each cut and attaches specialized particles, springs, and radial fields to each vertex.
- Sends the duplicate through a dynamic simulation complete with gravity. A collision plane is provided to "catch" the flattened duplicate.
- Transfers vertex positions from the flattened duplicate to the UV texture space of the original surface. Thus, vertex postions become UV points.
The most difficult aspect of this pelting method is the selection seams. Ultimately, the goal is to create an unfolded, nonoverlapping surface that fits neatly into the UV texture space. As an example of pelt.mel in action, a polygon ear is flattened (see Figure 9.9).
Figure 9.9
(Clockwise, from upper left) A duplicate ear awaits the dynamic simulation provided by pelt.mel; the ear dynamically unfolds; the final UV texture space; the UV texture space prior to the operation.
Figure 9.9
(Clockwise, from upper left) A duplicate ear awaits the dynamic simulation provided by pelt.mel; the ear dynamically unfolds; the final UV texture space; the UV texture space prior to the operation.
Pelting Tools, available at http://hydralab.com, uses a methodology similar to pelt.mel. It offers the advantage, however, of interactive tools to define seams and a graphic interface with a greater number of options (see Figure 9.10).
- Figure 9.10 (Left) A polygon head goes through a dynamic unfolding. (Right) GUI for Pelting Tools MEL script. A QuickTime movie showing the unfolding is included on the CD as head_pe1t.mov.
You can also create pelt maps in Maya with the standard set of uv tools. For example, in Figure 9.11 the uv points for the body of a polygon dog are left in one continuous piece. In this case, multiple uv mappings were applied to various parts of the dog. The resulting uv shells were then translated, rotated, scaled, and sewn back together with the sew uv Edges and move And sew uv Edges tools.
- Figure 9.11 The UV texture space of a pelt-mapped polygon dog
Applying UV Mappings
You can find UV mapping tools under the Create UVs menu in the Polygons menu set. The mapping tools include Planar Mapping, Cylindrical Mapping, Spherical Mapping, and Automatic Mapping. To apply a mapping tool, select a polygon surface or set of faces and choose the tool. For example, in Figure 9.12 the Cylindrical Mapping tool is applied to a polygon primitive helix. A projection manipulator instantly appears. You can interactively adjust the sweep, height, translation, and rotation of the manipulator by clicking the various colored handles. The green boxes adjust projection height. The red boxes increase or decrease the horizontal sweep (by default, the cylindrical projection only covers 180 degrees). To access the rotation and translation handles, click the red T and the bottom of the manipulator. As the manipulator is adjusted, the uv points automatically update in the UV Texture Editor (Window > UV Texture Editor).
- Figure 9.12 (Top left) Cylindrical Mapping projection manipulator applied to a polygon helix. (Top right) The polyCylProj! node in the Channel Box. (Bottom) The polyCylProj! node in the Hypergraph Connections window.
Here are a few additional tips for working with mapping tools and their projection manipulators:
Projection Manipulator The manipulator provided by all polygon UV mapping tools is finicky and tends to disappear when a mouse click is slightly off. Fortunately, you can bring back the manipulator by selecting the projection node. You can find the projection node in the Hypergraph Connections window (see Figure 9.12). You can also retrieve the manipulator by selecting the surface and opening the Channel Box.
The projection node will be listed under Inputs (see Figure 9.12). For example, a Cylindrical Mapping projection node will be named polyCylproj1. Clicking the projection node name reveals the projection's attributes and displays the manipulator in the workspace view. If interactive use of the manipulator proves impossible, you can set the projection node's projection Horizontal sweep, projection Height, Rotate, and other projection-specific attributes in the Channel Box. The projection node will remain connected to the surface shape and transform nodes until the surface's history is deleted. At the point of deletion, the uv information is permanently encoded.
Note: Although it is possible to overlap mapping tool projections, it is not recommended. Multiple, active, overlapping projections can lead to flickering textures. If multiple, overlapping projections are deemed necessary, delete the surface's history (Edit > Delete By Type > History) between applications of each mapping. Active mapping tool projections on a skinned, deforming character are equally problematic.
276 Multiple Projections You can apply uv mapping tools to entire polygon surfaces or to
" selected faces. on complex models, it often pays to apply separate mappings to various g sections; at the same time, it is useful to have all the uv points in a single layout. For instance, if the model is a character, the head is mapped first, then the torso, then one
z arm, then the next, and so on. This allows different mapping styles and orientations
to be applied. For example, the Cylindrical Mapping tool is applied to the head along the Y axis. The Cylindrical Mapping tool is applied a second time to an arm along the > x axis. separate planar mapping tools are applied to each hand. To replicate this pro cess efficiently, follow these steps:
1. select a set of faces. apply the most appropriate mapping tool. open the uv Texture Editor. If the projection manipulator is visible in the workspace
3 view, a corresponding translate, scale, and rotate handle is accessible in x the uv Texture Editor. Move the selected uv points into an empty area
outside the gray area of the full uv texture space (see Figure 9.13). When a the uv points are deselected, the entire surface becomes visible once again.
* The mapping separates the selected faces along the outer edges. (a group
o of separated uv points is called a uv shell.) If possible, separate the model
> at a natural border to avoid visible texture seams (for example, between a
- shirt collar and a neck).
- 2. Repeat the process for other sets of faces. Once all the faces have been et mapped, move, scale, and rotate the individual uv shells back into the
- gray area.
u 3. To see how faces have been split in the uv Texture Editor, right-click and choose Edge from the marking menu. Click an outer edge of an uv shell. The corresponding edge that was separated during the mapping process is highlighted.
- Figure 9.13 Creating and arranging multiple UV shells by applying multiple UV mappings
Although no technical problems will arise from separated faces, the separation can 277
make the texturing process more difficult. To avoid this, you can sew selected faces p r back together (for example, reattaching a neck and a head). To do this, select one or p
more edges and choose Polygons > Sew UV Edges in the UV Texture Editor window. |
The faces that were once separated are rejoined. Sew UV Edges moves the resulting U
sewn edge to a point halfway between the previously separated faces (see Figure 9.14). T
This may or may not be useful. An alternative is to choose Polygons > Move And Sew T
UV Edges, which forces all the faces connected to the selected edge to move up to r the second selected edge (see Figure 9.14). Move And Sew UV Edges does not prevent p
overlapping. If you need to manually split an edge, select the edge and choose Poly- S
- Figure 9.14 Reattaching a neck to a head with Sew UV Edges and Move And Sew UV Edges
Refining UV Points
Ideally, uv points should maximize the uv texture space without overlapping. The amount of space dedicated to each section of a model should be relative to that section's importance. In addition, distances between uv points should be roughly equivalent to the distances between the vertices that they correspond to. That is, if vertices on the model are regularly spaced, the uv points should also be regularly spaced. If the vertices on the model are closer together in the Y direction than they are in the x direction, the uv points should be closer together in the v direction than they are in u direction.
These guidelines are particularly critical for models intended for the video game industry, where textures are hand-painted and the texture resolutions are limited. For example, in Figure 9.15 a low-polygon character and a matching color bitmap are carefully laid out. Ideally, there should be a minimal amount of empty space left between the various uv shells.
- Figure 9.15 The UV texture space and matching color bitmap of a low-resolution polygon character
A good way to test uvs for potential stretching, pinching, or overlapping problems is to temporarily assign a Checker texture to the surface and choose shading > Hardware Texturing from a workspace view menu (see Figure 9.16). once an error has been located or a refinement planned, you can utilize a long list of Maya uv tools. These tools are available through the polygons menu in the uv Texture Editor window or through the edit uvs menu found in the polygons menu set. a few of the more useful uv tools are highlighted in the following sections.
MANiPUl ATiNg PoiNTS
You can select uv points in the uv Texture editor by right-clicking and choosing uv from the marking menu. once selected, uv points can be translated, scaled, and rotated with standard Maya transform tools.
Figure 9.16 Testing polygon UVs with a Checker texture
NoRMAl iziNg UVS
Choosing Polygons > Normalize in the UV Texture Editor fits the entire surface (or selected points, edges, or faces) into the full UV texture space. This ensures that a higher percentage of the UV texture space is utilized.
One inherent danger of the Normalize tool is the tool's inability to compensate for "stranded" points. Stranding is an artifact of the Cylindrical Mapping and Spherical Mapping tools (see Figure 9.17). If points are stranded, it's best to manually move them back to the main shell before applying Normalize.
Figure 9.17 (Left) "Stranded" UV points; (Right) Same points after choosing Normalize
Figure 9.17 (Left) "Stranded" UV points; (Right) Same points after choosing Normalize
RelAxiNg UVS
Choosing Polygons > Relax in the UV Texture Editor spreads out overlapping and/ or high-density clusters of selected UV points. For example, in Figure 9.18 a polygon ear has the Relax tool, with default settings, applied to it multiple times. Parts of the model that were once overlapping are flattened out.
Figure 9.18 A polygon ear before and after applications of the Relax tool
Krty
K/LYy
Original UV layout Relax applied 1 time Relax applied 6 times
Figure 9.18 A polygon ear before and after applications of the Relax tool
The following options can improve the quality of the relaxation: Edge Weights If set to World space, Edge Weights attempts to maintain the original world space angles between faces. If left on uniform, edge Weights attempts to make all the edges the same length. uniform produces a more drastic relaxation than World space.
Pin UVs and Pin UV Border If pin uvs is checked, pin selected uvs and pin unselected uvs options become available. If pin selected uvs is then checked, selected uv points will stay in place and unselected uv points will move as they are relaxed. If pin unselected uvs is checked instead, the opposite occurs. If pin uv Border is checked, the outer edges of the uv shell will remain fixed while the rest of the uv points will move. You can check both pin uvs and pin uv Border for a more refined result. Maximum Iterations sets the number of iterations permitted to the relaxation calculation each time the tool is applied. The lower the value, the more subtle the resulting relaxation. The higher the value, the more extreme the relaxation.
Note: If the vertices at the shared corner of multiple polygon faces have not been merged, the Relax tool will open a hole in the geometry.
lAyiNg oUT UVS
Choosing polygons > Layout in the uv Texture editor automatically arranges uv shells within the uv texture space. For relatively simple models, the resulting arrangement is neat and orderly. The Layout tool will even work across multiple surfaces. (To prevent overlapping, set layout Multiple objects to Non-overlapping.) since the tool leaves a significant amount of empty space, additional manipulation of the uv points may be required (see Figure 9.19).
- Figure 9.19 Before and after the application of Layout to multiple surfaces
Figure 9.20 (Top) The Create New UV Set attribute within the Planar Mapping Options window. (Bottom) The UV Sets menu in the UV Texture Editor.
Figure 9.20 (Top) The Create New UV Set attribute within the Planar Mapping Options window. (Bottom) The UV Sets menu in the UV Texture Editor.
CReATiNg UV SeTS
The creation of UV sets allows a single surface to carry multiple UV layouts. A UV layout is simply a unique arrangement of UV points. Since overlapping is not an issue for UV sets, each UV set and corresponding UV layout can cover the entire UV texture space. Without the use of UV sets, you must carefully arrange individual UV shells belonging to a single surface within the UV texture space (as demonstrated in Figure 9.13 earlier in this chapter). As an additional benefit, each UV set can support a unique UV layout even when polygon faces within the set belong to multiple UV sets. T
Ultimately, you can assign each UV set to a different texture, thus allowing for a r trl more complex and advanced texturing approach. A
To create a UV set during the UV mapping process, open the Options window S
for the Planar Mapping, Cylindrical Mapping, Spherical Mapping, or Automatic Mapping tool. Check Create New UV Set, enter a name in the UV Set Name field, and click Apply. Once UV sets exist, you can view them, one at a time, in the UV Texture Editor by selecting the surface and choosing UV Sets > UV_Set_Name (see Figure 9.20).
In addition, you can create new uv sets in the uv Texture Editor at any time. To do this, select a series of uv points, edges, or faces and choose polygons > Copy uvs To uv set > Copy Into New uv set > □, enter a name in the New uv set Name field, and click Apply. You can also copy uv points into preexisting uv sets by choosing polygons > Copy uvs To uv set > UV_Set_Name.
You can link uv sets to specific textures by following these steps:
- Create several uv sets for a surface. assign the surface to a material that has several textures mapped to it. For example, assign the surface to a Blinn material with a File mapped to its Color and a noise mapped to its specular Roll off.
- Choose Window > relationship editors > uv Linking > uv-Centric. The relationship editor window opens. Initially, the uv sets and Textures columns are empty. select the surface in a workspace view. The surface, with its uv sets, is listed in the left column. The assigned material, with its texture maps, is listed in the right column.
- Click the mapl uv set name in the left column. The map1 uv set is the default 282 uv set that contains all the uv points of the surface. The textures that the
" map1 set are linked to are highlighted in the right column of with a gray bar.
g You cannot directly disable the texture links to the map1 uv set.
4. Click a custom uv set name in the left column. The textures listed in the right z column remain unhighlighted, which indicates that there is no texture link.
g render a test frame. at this point, the render is standard and does not employ s the custom uv sets for the selection of textures.
> 5. Click a texture name in the right column. a link to the uv set is created. Click
| the mapl uv set name. Note that the texture linked to the custom uv set is
I now unlinked for the mapl uv set. The texture cannot be linked to the mapl
- set and the custom set at the same time. Render a test. The texture that is
- linked to the custom uv set appears only on those faces that belong to the cus-
| You can link a texture to one uv set at a time. If you wish to have the texture h linked to all the uv points, and faces, of a surface, reestablish the link between the
texture and the mapl uv set. To reestablish a link, simply click the texture name | so that it is highlighted with a gray bar. You can link a uv set to more than one o texture. When a link is made between a texture and a custom uv set, a uvChooser ai
§ utility node is connected automatically to the place2dTexture node that belongs to the texture.
g As an example, in Figure 9.21 two uv mappings are applied to a polygon prim-
^ itive shape. The Planar Mapping tool is applied to the topmost faces and receives a uv
5 set named uvset_top. The Automatic Mapping tool is applied to the entire model and receives a uv set named uvset_whole. The uvset_whole set is linked to a ramp texture node, which in turn is mapped to the Color of a blinn material node. The uvset_top set is linked to a fractal texture node, which in turn is mapped to the Bump Mapping attribute of the same blinn. Since only the top of the model has UV points within the uvset_top set, the bump appears only on the top and nowhere else. The ramp, on the other hand, appears over every polygon since the uvset_whole set contains the entire model in its UV texture space. This technique allows for specific placement of textures on a single surface assigned to a single material.
|
UV-centric UV Linking ▼ | |
|
UV Sets List Edit Show |
Textures List Edit Show |
|
1 | |
|
©^ Poiyshape mapl uvsetjop |
|
|
rsap | |
|
fractal | |
|
Figure 9.21 Placement of textures on a polygon shape is controlled by two UV sets. This scene is included on the CD as uv sets.ma. Note: To export a snapshot of the UV layout within the UV texture space, choose Polygons > UV Snapshot or Subdivs > UV Snapshot from the UV Texture Editor menu. The resulting bitmap will contain the full, 0-to-1 UV texture space and may be brought into a paint program. A Note on Subdivision Surfaces Subdivision surfaces do not support standard mapping tools. However, if you switch to polygon proxy mode, the mapping and UV tools are applicable. To utilize this method, follow these steps:
A limited number of subdivision UV tools are available through the UV Texture Editor. These include Cut UV Edges, Layout, and Move And Sew UV Edges. The tools are located in the Subdivs menu and function like their polygon counterparts. |
Post a comment