Glass & Transparency

UV Mapping

Resources

Looking for more?
You'll find instruction for lots of 3D apps at:

lynda.com

Making a texture in UV Mapper

This article was written in 2003. I no longer use UV Mapper, since the 3D program I currently use (modo) has excellent UV Mapping capabilities, so I can no longer answer any UV Mapper questions. This page is an archive; only the links and prices have been updated.

What is a UV Map? Simple. All models in 3D programs are actually a list of points in space, described by using the X, Y, and Z axes. X is usually defined as right to left, Y as up and down, and Z as forwards and backwards.

UV Maps allow each point to have two extra coordinates, U and V, which are the vertical and horizontal axes on a texture map that tells the program in question how to shade each vertex. Not all programs can read UV Maps, and not all file formats have this information. But, for those that do, it's a wonderful way to keep the textures on the objects no matter how they move, and no matter what their orientation is in space. It's also a great way to put shading exactly where you want it, vertex by vertex, instead of having to wish and hope while projecting a map on one axis or another and tweaking and rendering and tweaking again in a 3D application.

There are a number of programs that will allow you to assign the vertices in your model to a spot on the 2D texture map. (Also known as Assigning UVs, or Ordering UVs.) But the star of all of them, in my opinion, is a freeware program from Steve Cox called UV Mapper. It's available for both the Mac and the PC. At this point, Steve also has a Pro version for the remarkably inexpensive price of $59.95, that will do far more than the freeware one.

This tutorial, however, is concerned with the Classic UV Mapper, available from the UV Mapper Downloads page. It reads Wavefront .obj files, and allows you to assign UVs to the vertices with great flexibility and power. Then it exports the new, mapped .obj file, and the map as a .pict or .bmp file (depending on your platform.) This tutorial will be using the PC version. Although I use a Mac, I find the PC version of UV Mapper to be more robust. (Note; I haven't tried the recent versions.)

We'll be putting a UV Map on a vambrace that I made in LightWave for DAZ' Victoria 2 model. If you want to follow along, you can download the Vambrace.obj.

Warning Screen; No UVsSo, you have created (or downloaded) a lovely mesh; but you need to put UV coordinates on it, so it can read a texture map. You have downloaded UV Mapper (Thank you forever Steve Cox!) but you have no idea how to use it.

Let's take a look.

First, of course, you open the program and load your new model. You may get one of several things at that point.

If it has a beautiful UV Map already made, and you don't want to change it at all, go to the end of this tutorial and save the map.

You may get a tangle of lines, or UV Mapper may tell you that some of the Data is Out of Bounds. Or, if there is no map at all, you will get the notice shown above on a blank screen.

In all cases except the first one, you probably want to make a new map.

New Map PlanarGo to the Edit menu, choose New UV Map and then choose Planar from the fly out menu. This is the easiest kind of map to see, since it just shows your model from one side or another, depending on the axis you choose.

Planar Map DialogThis dialog box will open, that will allow you to choose the axis that you want to view your model from. If you are familiar with the program Poser, it you can tell pretty easily where in space you are.

X-Axis will be the same as choosing the Right or Left view in Poser.

Y-Axis will be the same as the Top or Bottom view.

Z-axis will be the same as the Front or Back view.

You can also choose whether the object will be split, and how, and how the two halves will be arranged. (Split by... and Orientation.)

Don't Split the model at this point; we want just one piece for now.

Leave Gaps in Map checked, although it doesn't apply at the moment, and leave Scale Result unchecked. (If you enable Scale Result, the program will scale each piece; but I find that I always have to resize them after it does. For me, it's just easier to eyeball the proportions when I'm putting the final map together. If that's difficult for you, by all means check Scale Result.)

Hit OK, and you will see a wireframe of the model, filling your screen.

Color Map by MaterialBy default, the map will be in black and white. It's easier to see what is going on if you choose to view it in color, however.

So, go to the Edit menu again, and choose Color > By Material.

Colored MapYour map should change to show each material in a different color. If it doesn't, then your map is all one material. Try to color by Group or Region. If those are also black and white, there is a limit to what you can do here.

If you have a modeling program that allows you to assign materials to things, you might want to import the model there, and assign different materials to any parts that overlap. It will make things much easier here.

If you don't, of course, then you have to just do what you can. Depending on the complexity of the model, that may still be enough. Good luck!

Reduce and DragIn any case, we need room to work, and this model is way, way to large. Hit Ctrl+A to select the whole thing, and then tap the / (backslash) key a few times. Each time you tap it, the map becomes one quarter the size it was.

Make it tiny, and then drag it down into the lower right hand corner so it's out of the way.

Select by MaterialWe are going to pull one Material at a time from the model, and arrange it so that it will be easy to paint in a graphics program.

So, go to the Edit menu, and choose Select > By Material. (If you didn't have materials, and you are using Groups, or Regions, you would select by those, of course.)

Materials AvailableA dialog box will open that has a list of all the materials in your model. Choose whichever material you want to start with.

I usually choose the one that is the most important. In this case, that's Leather_Outer, because it is the outside of the vambrace, where the tooling will go in the finished model.

First Material IsolatedThe material you have chosen will be highlighted in dark red. Place your cursor on it, and drag it away from the rest of the map, into the center of the screen.

Take a look at it. Can you see all (or most) of the area? Or would it be better if the map was applied differently?

New Map CylindricalThere are several mapping modes to choose from.

Planar just looks from one side or another.

Box assigns all the polygons to one of six sides, depending on how they are facing. It's great for boxes or other regularly shaped things; but can be very confusing to paint on more organic forms, especially when you are just beginning to understand the program. (As you become more adept, you can drag the facets around and get a lot of use out of it; but it is still pretty time consuming.)

Cylindrical unwraps the facets, so that you can paint a map and then wrap it back around. It's great for things that you could slide into a tube.

Cylindrical Cap is like Cylindrical, but also assigns any facets that are pointing at right angles to the cylinder to a cap. This keeps you from having to stretch the top and bottom of things that have tops and bottoms.

Spherical unwraps the facets in the form of a sphere, of course. You would use it for things that would be more comfortable in a ball than in a tube.

Since the Leather_Outer material is roughly the same shape as a sleeve, it will go nicely in a tube and doesn't need the ends. So I'm choosing Cylindrical Mapping.

Go to the Edit menu, choose New UV Map, and then the type of map you want to use from the fly out menu.

Cylindrical DialogWhen you choose it, a dialog box will open that allows you to parameters for that Mapping mode.

Since I chose Cylindrical, I got a dialog that's a little different than the Planar dialog, as you can see. This is the one that is used for Cylindrical, Cylindrical Capped, and Spherical.

Alignment, of course, let you choose which axis you are wrapping the map around.

If you want the map to wrap around the vertical axis, for instance if you were mapping a soda can that is standing upright, you would choose Y-Axis.

If you want to wrap the map around the axis you are looking down as you look at your model from the front in a program like Poser, you would choose the Z-axis.

If you want to wrap the map around the axis you are looking at the side of when you look at your model from the front in Poser, you would choose the X-axis.

(Since we chose to map the first Planar map from the Z-axis, it makes this choice easy. If you are looking down the tube, choose the Z-axis. If you are looking at the side of a tube that's lying down, choose the X-Axis. If you are looking at the side of a tube standing up, choose the Y-Axis.)

If you want the seam of the cylinder to start in a different place, you can do that with Rotation. The seam will be at the bottom of the model if you are using the X- or Z-axis, and at the back if you are using the Y-axis. This is generally where you want it. (I'll be talking more about Rotation in a bit, if you need it.)

Offset lets you wrap the cylinder around a different center point. UV Mapper calculates the center point by looking at the edges of a bounding box that surrounds the center, and taking the point in the exact middle. (The Min and Max for each axis.)

If you know that the middle of you model isn't in the center of its bounding box, you can offset that point here. There is no easy way that I know of to calculate the offset, but you can get a starting point by going to the Help menu, and choosing Dimensions. A dialog will open that tells you the Min and Max values, which will give you a starting point. Fortunately, you won't need this often. (If you choose your material wisely, you may never need it.)

In this case, I need to wrap the map around the X-axis, so I chose that.

If you get something like this for a Cylindrical Map, Just choose a different axis, and try again.
Wrong Axis Correct Axis

If you choose wrong, though, it's easy to tell and easy to fix. If you map looks like this one, just choose another axis.

Drag AsideContinue to select each piece, determine the best mapping mode for it, and make a new map.

As you finish each one, move it to the edge of your screen, out of the way, so you have room to work. Leave them all small, for now. If you need to make any pieces larger to work with, go ahead. (You can quadruple the size with the * (asterisk) key.) Just make them smaller, and shove them out of the way, when you are finished.

Be sure to save often as you go. Don't save the map; just the model. You can always load it again if you have to, and the map will be there just like this. (Don't worry about the settings for now, either.)

Tilted PieceOccasionally, as you work, you will come across a bit that is not lying square to the Axis. If you map it like that, you will build distortions into your map, which are better to avoid.

You can fix this pretty easily.

Edit > RotateGo to the Edit menu, and choose Rotate, to rotate the model. (Not the map. You will have to make a new map to see the rotation.)

Rotate Model DialogA dialog box will open that allows you to set the rotation you desire, in whole degrees. (No fractions here.)

There is no visual feedback; nothing to let you know when you are where you want to be. But, if you have Poser, (or a similar program,) there is a workaround. Just load your model there, go to one of the orthogonal views (Front, Back, Top, Right, etc.) and rotate your model until the problem part looks square to the axis.

Then, copy the numbers for the degrees of rotation into these boxes.

Straightened PieceThat's all there is to it. If you make a new map of the same type now, you will be able to see the rotation.

MappedThen choose the mapping method you need, and go ahead and make the new map, of whatever kind you need. (This is Planar using the Y axis.) The model will retain these rotation values until you change them. (So, if you need the whole thing rotated, you can do it, and still remap each part as you need it. Or, if you need to rotate it this way and that as you go, you can do that, too.)

Straps Y Planar MappingOccasionally, you may find that you want to use two mapping modes on two parts of a single material. For instance, the straps for my vambrace.

I need Planar projection from the Y axis for the strap around the arm, so I can tool it. But I would rather use Cylindrical Mapping for the wrist band.

Once again, it's not difficult. Select the material, and make the first map. Tap the Enter key, or click in any empty area, to drop the selection.

Select WristbandThen drag a marquee around the area that you want to map using the second method.

Wristband RemappedNow make the second map. If you don't have Scale Result enabled, the new map will exactly fill the selection box you dragged out. (See why you need space to work.)

Vertices Dragged to MatchSometimes, you will want to take vertices from one part of the map, and move them to another. I'll show you that using the same wrist band. (I have to mention here that for this it would be easier to just change the Rotation in the UV Mapping dialog to 180°, so the seam would be at the top. But for purposes of illustration...)

All you have to do is select the vertices that you want to move, and drag them to the new position. You can use the arrow keys on your keyboard to nudge them in 1 pixel increments (or shift+arrow to nudge them by more,) so it's easy to do.

That's all there is to it. When you select it now, it will all act like a single thing. In fact, you can put stuff that should belong with one material with another this way, and combine them both in the same map if you are so inclined.

You can do pretty complex things using these methods alone or in combination. For instance, you can cut the sleeves off a shirt by pulling the facets that make the sleeves to one side, and piling them all up on each other any old way. Then, select the whole batch by drawing a marquee around it, and make a new Cylindrical map. UV Mapper will straighten them all out, and give you a lovely sleeve.

Map ReproportionedAs you can see, the proportions for the wristband are all wrong now. But, once more, it's easy to fix.

Just grab any of the control handles, and drag to resize. Or, if you prefer, you can make your selection (and the vertices in it) larger on the X (horizontal) axis by tapping the x key. Shift+x makes it smaller. If you want to resize it on the Y (vertical) axis, use the Y key. If you want to make finer adjustments, use the U and V keys the same way.

Buckle Map SplitIf you decide that you want a map for each side of the piece you are working on, like this belt buckle, you can easily split the map if you are using Planar Mapping.

Split DialogJust choose the kind of split you want in the dialog that opens when you make a new map.

 

Split Orientation -
Which way are the vertices facing?
Split Position -
Where are the vertices?
Nearly All on Right Half and Half

Splitting it by orientation will split along the axis you are using for the map. That is, it would split into the top and the bottom if you were using the Y-Axis, the left and right using the X-Axis, and the front and back using the Z-axis. (Once again, taking the orientation as you would look at your model from the front in Poser.)

When it splits the map, it takes all vertices that are facing one direction, and puts them on one side of the map. All vertices facing the other are put on the other half. So, depending on how the normals lie in your model, you may find your map cuts the model exactly in half, or you may find that nearly all the vertices are on one side or the other.

Splitting by Position simply cuts it in half along the center of the axis. Offset lets you offset where the center is, of course. Once again, you can get a hint from checking Help > Dimensions; but it's not easy to figure out.

Vertical Orientation Horizontal Orientation
One Above the Other Next to Each Other

In addition, you can choose to have UV Mapper place the new map so the two halves are arranged vertically, or so that they are arranged horizontally. Just check the one you want in the Orientation check box at the upper right corner of the Planar Mapping dialog.

In all cases, I highly recommend that you choose to leave gaps in the map. If you don't, sometimes a vertex will be caught between the two halves, which can make it difficult to paint later.

Messy MapWhen you have everything mapped to your satisfaction, you should have a bunch of tiny pieces shoved into the corners, and a lot of "dead" space. That clearly won't do.

It's time to arrange the pieces on the paper to form the map you will paint.

Finished MapChoose the most important thing, and make it as large as you can. If there are several pieces that are equally important, of course, you will have to compromise.

Basically, you want to leave a few pixels of white space between the parts on your map; but no more. That will allow you to get as much detail as possible on the same size map. (And since size is where the big memory hit comes, you may as well use it.)

There are a bunch of tools to help you with this part. The resizing tools we have already covered.

If you want to flip a map piece on the X axis, tap Ctrl+X. On the Y axis, tap Ctrl+Y. This will often let you arrange pieces more closely to each other.

If you want to draw a marquee around a piece, but another is in the way, you can select the second by material, and tap the [ (open square bracket) key and the facets will become invisible. Draw your marquee, move the selection, and select the second material again. Tap the ] (close square bracket) key, and the facets will reappear.

If some of your facets are visible, and some are invisible, tap the \ (reverse slash) key to toggle them back and forth. (That's how you make two maps for one object, by the way.)

Butterfly BackgroundBest of all, in my opinion, you can load a picture to use in the background. So, for instance, if you have a perfect picture of a butterfly's wing, you don't have to distort the picture in Photoshop to make it fit your map. You can make the map fit the picture right here in UV Mapper!

To load a picture, tap Ctrl+B (for background.) Ctrl+C clears it. Ctrl+U flips it horizontally, and Ctrl+V flips it vertically. Tab toggles the background visibility on and off.

Two caveats about using background pictures. First, they have to be .bmp files. Second, if they are not the same proportions as your screen, they will be distorted to fit.

Eventually, you will be finished, and ready to save your model and map.

Export Options DialogYou should already have saved the model several times, just in case, so you should be familiar with that save dialog. Generally, you can leave the defaults just the way they are; but do check Don't Export Linefeeds if you want your friends with Macs to be able to read the model. (This won't affect the ability of PCs to read it, as far as I can tell.)

User Settings DialogBefore you save the Texture Map, you need to go to Edit Settings. If you don't, you are very likely to wind up with proportions that are nothing like the ones you see on the screen. Set the dimensions, in pixels, of the texture map that you want to output.

If you were using a background map, you will want to use that size (or at least those proportions.) For other things, you will probably need to experiment a little. Export a map, Select All in Photoshop, and size that selection until it looks right. Then copy and paste it to a new document. The size of that document is the size you want for your proportions.

In my case, using a (virtual) monitor size of 1024 x 768, I have found that saving the Texture at 1024 x 662 gives me the same proportions as a Maximized screen.

Vambrace Rendered in BryceI do recommend that you check it out before you actually spend any time painting it. Import it into a program where you can render it, apply the map just as it is, and render from a few angles to make sure all is as it should be. Save the Texture, and you are ready to go into your favorite graphics program, and paint your map!

Book Render; Reversed Type on BackIf the finished texture will have any parts that cannot be viewed backwards, such as writing, I recommend that you put numbers or letters on the parts and render before you spend time painting. Depending on how your model was situated in UV Mapper's memory, you may find that some surfaces are back-to-front, which has the effect of reversing your type, since you are actually looking at the back of the vertices in the map.

You can either fix that in UV Mapper by rotating the object and trying again, or you can just flip the part in your graphics program, so the type looks reversed in the map, but shows correctly on the model.

Once you are sure that all the parts are present and accounted for, and everything is facing a predictable way, you can start to paint your texture. Have fun!