UVW Explained

Jet fighter by Dan Dekowski, rendered as mesh

Jet fighter modeled by SDE student Dan Dekowski, rendered as mesh.

The most common and powerful application of 2D graphics in game development involves textures for 3D objects. In games, characters, landscape, and manipulable items consist of meshes -- sets of points in space (vertices) connected by lines or curves (edges) to form polygons. To produce a convincingly realistic figure, the game's 3D engine stretches a 2D image (the texture) over the mesh. This effect is usually achieved with a technique called UVW mapping.

The term "UVW" refers to a second set of 3-dimensional axes -- U, V, and W -- which are mathematically superimposed on the original X, Y, and Z of the modeling or game world ("UVW" is the string preceding "XYZ" in the alphabet). UVW texture mapping lines up regions of an image with defining features of the model (vertices, edges, polygons), so they can be drawn in the game.

You'll learn the 3D side of UVW texturing in other classes. For the moment, let's get acquainted with the 2D end of the process.

Basic concepts

Head texture for Maria character by Newherve

Head texture for Maria character by Newherve. Click to view at larger size.

Because textures are 2D objects or imagemaps, they have to start out in Flatland, a domain of two dimensions (X and Y, width and height). Thus texture graphics always look (disconcertingly) like a flattened skin. Consider the texture at right, which was developed for a photorealistic female figure. As you can see, the texture is basically the model's face and scalp, laid out in a single plane. It might look like something out of a horror movie.

However, there's more than just the skin of the face involved here. The pink and red regions at the lower left are textures for the character's tongue and interior of the mouth. If you look closely, you'll also see some V-shaped, light pink features. These define textures for the lachrymal sacs (tear glands) that line the eyes. (This model uses separate texture files for the eyes themselves, so the eye sockets on this head texture are blank.)

Maria character rendered

DAZ Studio Render of Maria character for Victoria 3 figure. Click to view at full size.

This odd jumbling of textures is typical of UVW maps. It's basically an efficiency measure: putting textures for the tongue and mouth into the same file that covers the face and scalp eliminates the need for a separate texture file. The software that applies this texture -- in this case, a 3D rendering program such as Poser or DAZ Studio, but just as plausibly, a game engine -- knows which regions of the image contain the texture for the tongue, and which the scalp and face. This information is stored in the data file that represents the finished 3D character.

As we noted, you won't learn how to generate that information in this class, since it involves some fairly detailed understanding of 3D modeling tools. However, you can produce significant effects simply by manipulating a texture file (that is, a 2D graphic) that has been attached to a 3D model via UVW mapping.

Rocket with multiple texture maps

Simple rocket model with multiple texture maps. Click to view at full size.

Because it illustrates our skin metaphor so well, we've used an example from 3D art, not a game. The character is called Maria, developed in 2003 for Digital Art Zone's Victoria 3 figure by a Net artist working under the handle Newherve. When this character was produced, most game engines could not match the resolution or level of detail used in the project: consider, for instance, those fine freckles on the character's cheekbones.

3D art programs are typically used for static graphics or brief animations featuring only a few characters. By contrast, game engines have to render groups or swarms of characters, and they have to do this 60 times a second. In most video games, you're moving or otherwise changing your viewpoint quickly and constantly. Who has time to stop and admire rose petals? Who needs freckles on a zombie?

However, as we move into later generations of game platforms and engines, the fairly moderate realism seen in the Maria character seems increasingly plausible, at least for Triple-A games. Indeed, by the time you read this, images like the one above may seem quaint and stylized, in comparison to contemporary in-game graphics.

Meanhile, here's a more modest example with a lower polygon count (see the third image, above right). After modeling this simple rocket in 3ds Max, I applied the Unwrap UVW modifier, using it to generate a template for texturing:

Rocket UVW template

This template divides the model into three regions -- nose cone, fuselage, and fins -- because I assigned the polygons in those regions distinct ID numbers. Doing this allows me to separate the regions in my template. I can then develop a texture (basically, a paint and surfacing scheme) for each region, using brushes and texture-map sampling in Photoshop. The result looks like this:

Texture for Diffuse channel on rocket

The texture shown above is attached to the Diffuse channel of the model, which controls the way the surface of the model responds to ordinary, diffuse light. Diffuse light bounces around the world and generally makes everything we can see visible. It differs from specular light, which tends to bounce straight back from the object to the eye, creating highlights.

Once I have a UVW mapping in place, I can apply imagemaps to other channels besides Diffuse. The rocket example above uses a second map for the Bump channel, which extrudes or intrudes features, depending on its setting; and for the Displacement channel, which also gives local dimensionality to surfaces. These additional maps are different from the basic, Diffuse map: they're in grayscale, and they don't necessarily cover the entire model; but they both work through the same UVW framework.

You can see the effects of these maps in the rendered image of the rocket, above. The lines that suggest panel joins or welds are derived from a Bump map generated by converting the UVW template itself to black and white. The Displacement map applies a grayscale version of the quilted-steel texture applied to the fuselage, creating the in-and-out variation of the surface.




University of Baltimore Logo

Last updated: 10/17/09 18:07:54
Copyright © 2009 School of Information Arts and Technologies