UV Mapping for beginners

Originally published in 3DW 137

Literally the glue binding a model and it’s texture together, UV mapping is ironically also one of the least popular tasks in 3D. Often with good reason, as the process of  flattening a  3D model’s topology  into a 2D map in order to create a distortion-free map for texturing  at times can be both frustrating and time-consuming. As a good UV map is alpha and omega for a good texture, it pays to spend some time creating a good UV map and UV mapping workflow for yourself. If your map is distorted, your texture will look distorted, in effect making your model look distorted as well. If you’re a newcomer to UV mapping, it’s fairly common to find the entire process an incomprehensible soup of terms and concepts. If it’s any consolation, it will pass, and UV mapping has become a lot easier in recent years, as the demand for better, easier and friendlier tools has grown. In addition, there are a few new applications on the market which make it even easier. On this page, we’ll explore the basic concepts which underpin UV work, provide an overview of the UV mapping workflow, explain some of the common technical terms, and summarise the key software packages involved. While it isn’t intended as a hands-on tutorial, you can find a bonus three-step walkthrough on UV mapping a horse on clicking the quadruped tab above.

The Fundamentals of UV-space

UV mapping has it’s name because it maps coordinates. As a 3D model has XYZ coordinates, 2D space has corresponding UVW coordinates, where the horizontal X axis equals U in 2D space,  vertical Y equals V and perpendicular Z equals W. The letters UVW are used to avoid confusion with XYZ, and for newcomers it’s important to remember that what happens in 2D space, stays in 2D space – so if you mess around with a UVmap, you’ll be messing around with the map of the model, not the model itself. (which may be a relief to know)

Like 3D space, UV space has horizontal (U) vertical(V), and perpendicular(W) coordinates. UV space is between 0 and 1, 0,5 being the absolute middle - which is why some prefer UV grids on a hard 1k

Some may wonder why there is a 3D coordinate included in 2D space, and the reason for a W to be included, has, among other things,  to do with geometry-related issues like orientation -  If you’re going to i.e flip something in a different orientation on the map, you’ll need the W coordinate to do it right in relation to 3D space.

Before you start UV Mapping

So what constitutes a good UV map?  Probably obvious to experienced modelers and texturers alike, but maybe not for a beginner, is that there are some loose rules of thumb which really help making your map shine and texturing easier:

  • It’s as distortionless as possible, meaning a texture won’t look deformed when applied onto the model.
  • It  tries to keep seams to a minimum, as the more seams, the more time-consuming it will be to texture and match them up. A little distortion may sometimes be better than an ocean of seams, especially on a complex or organic model, unless you need everything to be pixel-perfect from every angle.
  • Seams should also be as inobtrusive as possible, meaning they’re placed and cut in low visibility locations, such as  i.e where a wall and a vent meet, under hair, inside armour, under an arm, on the side of a torso, or on the bottom of a grip for a gun.
  • A good UV map also needs to be properly scaled, meaning that all textures painted onto it, will not show disproportionate to eachother, like a jacket showing incredible detail on the torso, and the arms having the same detail, only 75 times larger.
  • It also has borders and padding: If you put the items on your map to the outmost edge, you’ll be asking for seam-trouble – you can avoid this by adding a 3-5 pixel border to your map.
  • The items on your map will also need padding: If you put them right next to eachother with no room between them, you”ll risk the texures bleeding into eachother.  Of course can you try avoiding this by having a base texture under them, but your best bet is to pad the islands with it 2-3 pixels as a gutter to avoid it all together. Just remember, amidst all the padding, to keep your items within the UV grid, the square area in most UVmappers – most things outside of it may not show, or show warped.
  • Try to be economical with your space: If you know parts of the model will share the same texture, try stacking them on the map in order to save space, allowing more space for the items which need finer detailing or have higher visibility, as the larger the item on a map, the more space it gets for painting and detailing.

When stacking UVs, remember to flip them, otherwise the texture will show as flipped, something a black and white chequer map won't pick up on

And, of course, it needs to be properly laid out, meaning connecting islands are arranged logically, and if possible, colourcoded, and that the map is easy to work with. This is a fairly tall order, even for experienced UV mappers, let alone beginners, especially if you’re new to both toolkit and concepts. So how do you go about the process of generating a UV map like this? First of all, practice, practice and practice.If you’re new to UV mapping, try to map anything  you can get your hands on, especially other people’s models: You won’t have the same level of control as if it were your own,  but you can learn a lot from other people’s modeling and mapping technique, or  lack thereof.

Give yourself a head start

When working on your own models, one of the best ways to create a good UVmap, is to start before you even start modeling, by thinking through your pipeline, even though you may not be the one doing all the tasks involved:

  • How are you going to model your object?
  • What’s the final render l? A still? Animation? In-game?
  • Which sides will show?
  • Who’s going to texture and UV map it?

- and so on.  All these have an impact on how you may need your map to be: If you’re creating an in-game model, you’ll need to be very aware of polycount, texture compensating for lack of detail in the mesh, and swappable parts, like i.e one head or body using multiple UV maps to facilitate multiple textures to create variety in the game. Even a simple thing like tidying your mesh as you go can yield UV mapping benefits, as things like leftover faces, too many deleted faces, unclean edges, often only become visible and a potential hassle when you start UV mapping.; Checking issues like these during modeling and before you start mapping can be a real timesaver, as it facilitates i.e easier cutting and potentially less distortion when you try to run it through certain mapping projections. You may also want consider symmetry, as in which parts of the map (and model) can be mirrored, and which need to remain unique. In both modeling and texturing, asymmetry is what usually makes a figure or texture look interesting, but using it often saves time. In a UV mapping application it can give you the advantage of needing to map only half of your figure before you can copy, flip, and weld the items you mapped, or stacking items. Also, when modeling, try to generate natural seams – areas with edges or edgeloops where it’s natural to split the mesh for flattening,  It’ll make it easier to cut your map into natural mapping chunks whilst at the same time also making sure that areas where the textures meet are as unobtrusive as possible.

It's usually easier to map a straight item than a bent item. One workaround is to UV map the straight item, and then apply the map to the posed and rigged item, provided nothing else has changed.

Another issue is that sometimes UV mapping a straight model or piece of a model, is easier than UV mapping something bent, or at an angle; If you’ve for example modeled a figure with slightly bent arms, legs or tentacles, you may want to straighten these for UV mapping. To do this as non-damaging as possible, cloning your model, straighten whatever needs to be straight, and UV map that figure instead. Provided you do not change anything else, especially not the polycount, you can then export the UV map you created on the straightened figure onto the original figure.

One of the oldest tricks in the book STL-checking your model prior to mapping can show problem areas you may want to clean up before you start mapping

Working with your map

When you’re finished with your model, it’s time to start mapping for real. If you’re a beginner, spend some time testing apps and demos to find one you “click” with – most modelers and standalone applications have native variations on how to do things, but their base functions are the same. Most of them also have native UV-grids, the chequered maps showing you where the distortion on the UV map is. The problem with a lot of these maps is that they can give you mediocre results. Black and white or colour -chequered UV grids without letters or numbers on them may not pick up finer details like stretching over smaller areas, flipped UVs (the applied texture showing in reverse), and mismatched bitmap space. To obtain one, make your own, or Google the phrase “UV grid”

A good UV grid helps find distortion and other issues

It’s often the unwrapping itself which is the most labour intensive part of the UV mapping process. Workflows are a very individual thing, but a good place to start is to apply a two-sided planar map if you can, so you can see most of the model’s faces in 2D. If you haven’t cut your mesh yet, it’s also a good projection to start your cutting with. For the unwrapping itself, begin with the most complex or largest parts first. As they’re often the most visible and time consuming parts of a model’s map, it’s here you have the least leeway when it comes to time and errors, so spend time getting these as flat as possible. A distorted nail is for instance less of an issue than a whole body full of strangely stretching skin. Choosing which projection to apply to your map is also an individual thing: Some prefer to have control over the map old school style by using planar mapping or auto-unwrapping and hand-stitching, others prefer the ease of use and amazing results cutting seams and running a combination of pelt mapping and relaxing can give. When it comes to the UV mapping process, there really are more ways than one to skin a cat, so to say, just keep in mind that unless it’s a very simple model, one projection rarely unwraps the whole map in one go. Having said that, organic models like i.e said feline take very well to the  UV mapping developments in recent years. Functions like LSCM and Pelt mapping, relaxing – evening out the space between vertices on the map parametrically -  mean you’ll probably be better off using these than i.e ye olde combo of mixing planar and cylindrical projections and handstitching them together in order to properly map organic shapes. You may still have to stitch, though. Despite the fact these functions take a lot of work and pain out of UV mapping, you will still need to tweak your map manually, either in the form of added cutting or  relaxing to get rid of overlaps, manually tweaking via moving vertices around, and, if you’re going for as continuous an organic map as possible, sewing islands together and tweaking those too.

Organic projections like pelt mapping may not always be as successful on hard egded objects as on organic objects

On maps for hard-edged models, ye olde projections are still (mostly) the way to go, as i.e autowrapping, pelting, and LSCM mapping do crazy things to your UV map, making it close to impossible to texture it, like breaking it up into little pieces all over the place, scrunching the map into a tangle of faces, or turning it into spirals. Try cutting these maps according to the way they are separated in real life objects for the best results and ease of texturing.  Even though the relax function is a godsend for maps like these too, make sure that you keep your lines as straight as you can, as hard edged models  often show distortion easier, and are more subject to being textured with decals and straight lined items, and these will look horribly skewed if the UV map is skewed. If you’re unsure as to how to map your model, the best place, again, is to start mapping via planar maps, and a relax function – it may be very slow going, as it is also one of the most distortion prone projections there is, but it’s fixable, and it will get you started. However, don’t be afraid to experiment mess about – you’re working on the map, not the model (just remember to save often) When you’re done mapping, and finalising your map, run a final test with a different UV grid and a set of generic textures, just to doublecheck everything is ok. Also, if you have time, try help the texturer out by providing a seam guide – coloured edges on the UV islands, matched up with the coloured edges on other islands so they match up in 3D view – especially if you know you’re not going to do the texturing.

Utilising a seamguide can help your texturer match seams easier

Watch the screencap on Vimeo

(I’m currently reworking the video  - it will be up Aug/Sept ’11. Please note that I didn’t speed up the screencap on purpose, as it’s easier for beginners. In addition, I’ve stayed away from a lot of the shortcuts – I do believe you need a base understanding so you can use them better. For extended shortcuts use – check out my “How to cut UV mapping Seams” -tutorial instead )

1: Getting started

Click About UV Layout> Preferences. Press Map, and locate your UV grid. Press 3 to access the mapped view, and press t to cycle through the textures until you get the UV grid. Click Load, and locate the zhorse.obj (it was included on the 3D World #70 CD, or you can just grab the Poser nag) Make sure your load options are set to Type: SubD and UVs: New. Click Groups. In the Material Groups list select all groups (CTR + Click), except Hide.

You’ll see them turn green in the UI. Click anywhere outside the horse, and press h. We’re going to hide the bits we’re not going to work with, so press g when you see the menu appear on the bottom of your screen. In order to unwrap the horse, we’ll need to cut it’s seams. The easiest way to do this, is to use symmetry. Go to Edit, and press FIND next to Symmetry. Select the mid-seam on the horse’s underbelly by clicking it with your left mousebutton, and pressing space to continue. Half the model will turn dark grey. With Symmetry, you’ll only have to cut on one side – your cuts will be mirrored to the other side. When selecting seams, stay on the light side, and remember to use backspace to erase edges you don’t need.

If it all becomes a real tangle, click Untag Edges in the Edit menu. Save regularly, using Update instead of Save.

 

2: Cut, weld and optimise

Start with the horse’s head. Select an edge under it’s cheek, by pressing c. Select the loop around the head so it meets on top. Remember to also select the edges left open due to the hidden parts, otherwise they’ll follow your shell. Select the midseam under the horse’s head as well, and press Enter to cut the seam. Press d to drop it into the UV editor, and u to enter the UV editor. Select the head and press Shift + f to unwrap it. In the Optimise menu, set Run For to 5 minutes, and press the red Run For button. Cut the neck next, in the midseam under, ensuring your seams stay consistent, and around the chest and neck.

Drop it into the UV editor, and again, press Shift + f. Move it away from the mapped head by pressing Space and your middle mouse button. There’s a lot of cutting to be done on the torso: Select the midseam on the underbelly.Follow it down and around the open edges of the tail. On the front and hind legs, mark the open edges, and press Enter, to detach the hooves and tail. Select the midseams on each leg, and cut the seam.

To detach the legs from the torso, select a natural loop as high up as you can on the leg, mark the seam, and press Enter. Click on the torso, and drop it into the UV editor. Move it away from the head and neck. Unwrap and Optimise it. (Shift + f and Run For) Go back to the editor, and press d to drop the hind legs into the editor. Clicking only the light grey leg,  unwrap and optimise it. When it’s done, select the shell, and press s – and the other hind leg’s shell will unwrap too. With the light grey hind leg still selected, move it next to the light side of the torso. Press w on it’s upper edge to select weld seams, as we’re going to weld the hind leg back onto the torso. Press Enter to weld. As you can see, the other leg has been welded to the torso as well. Optimise and set Run For to 10 minutes- Press Space to stop when you see it’s evened out enough, and press s on the light side of the model to mirror the unwrap.

Repeat this process for the front legs Check for Overlap by pressing the Overlap button in Edit. You’ll see you have a little in the area where the front leg meets the stomach. Zoom in on the area, press r and the left mouse button to activate it. When you move the mouse, the faces will follow. Move the faces down and to the left. Press s on the light side of the mesh to mirror this to the other side, Whilst still in the UV editor, move the neck to the top of the unwrapped torso, and mark the seams, weld it in, and optimise. You may see it move around on the screen a lot – don’t worry about it, it’s just the mapper doing it’s job. You may have some remaining stretch or compression around the mane and some of the chest. This will need to be tweaked manually,so press CTR + Left mousebutton to move points, and Shift + CRTL + left mouse button to move faces in increments of four. Press s on the light half again when you’re done.

 

3: Final mapping and packing

Press e to go back to the editor; and press h and then u. Work your way through the remaining shells, down the Material Group list, and select, drop, and unwrap all items. The hooves, tail and lashes will need a seam in the back to unwrap properly, so remember to cut them. When you’ve worked your way through everything, click Pack. In the pack menu, click Best for Quality, and set Bleed to 4. Click Pack All. As you can see it’s perfectly packed, but according to the math, not ease of texturing. Tweak the map by matching the horse’s body up to the head by rotating the head, so the symmetric grey lines up by using Space + left mousebutton. Continue tweaking by putting items next to their corresponding seams and shells. As we have a lot of space to move around in, we can put things next to eachother instead of stacking or packing real tight. The current scale on the map is even, so if you want finer detailing, enlarge the relevant shells by pressing Space + Right Mousebutton. Be careful, though. Update the object, and save your map via Render>Save, with AA checked.

When you're done, your UV map should look similar to this

When you’re UV mapping, the flattening process involves, among other things, projections – ways to project a (texture)map onto a model.

If you’ve seen maps of the Earth in an atlas, you could say you’ve seen a UV mapped and textured sphere – the geometrical form of the sphere was flattened by using a spherical projection, and then textured with a world map. Below is a short collection of common projections found in most modelers and standalone mappers.

Remember to not start texturing before you’re 100% done with your model and your map – this to avoid having to start over again.

  • Planar

A planar map (or projection) is one of the most used UVmapping projections around because of it’s versatility. It works like projecting a slide onto a wall, meaning it will map your model as if you saw it right in front of you. This means you will see what IS right in front of you, on any of the axis’ but, especially on organic forms, it will show the sides very compressed. It’s commonly used to map objects like walls, floors, boards, straight roads, and decals. Also, a planar projection is a good place to start mapping, as starting by applying a planar map makes the map you’re working on both easier to see and cut, in turn making it easer to further unwrap and/or sew.

  • Cylindrical

A cylindrical map projects the map around the object as if it were a cylinder. You’d therefore typically use a cylindrical map on all things cylindrical, like pipes, poles and handles. You can also use it on less than perfect cylindrical shapes like arms, legs, and bottles – but you’ll usually need to even out the map if you do. Most applications offer a Cap function when using a cylindrical map. This means that your map will be laid out with the length of the cylinder, but with the caps mapped separately. Handy for dustbin lids or similar objects. If you use a cylindrical map on something, remember to spend some time checking where the seam will be the least visible.

  • Spherical

Projects the map around an object as if it were a sphere. You’d therefore obviously use it to create a map for planets, sports-balls, marbles, etc. As with cylindrical mapping, you’ll need to take care where you choose to put your seams. Note that unless you’re using a Geodesic dome for your sphere, you will probably run into some pinching at the top and bottom. Some fix this by running a relax, others fix it by either projection painting a texture onto it, or conveniently putting icecaps on top and bottom to simulate the poles.

  • Box

Also known as cube/ic mapping, a box map projects as a planar map, but from all six sides of a box. If you use it on anything but a cube, box, crate, or a building, it will map all the selected faces as if they were part of a cube, and lay them out into the closest box surface whose normal most is closest to it’s own. If you have a very tangled model to map, sometimes it helps to use a box map to untangle it, as it tends to chop up the area to which it’s been applied into little bits, form which you can start untangling and reassembling bit by bit. This is a very onerous way of doing things, but it does help with the untangle, which you can then unwrap further, if nothing else does.

  • Face

Projects a copy of the texture map onto every face of your selected model. It’s useful for i.e equally shaped objects like geodesic domes. Be aware that facemapping will put the same image on every face of a mesh.

  • Automatic unwrapper functions

Also known as Flatten or Atlas in some applications. These functions completely flatten your map.Whilst this sounds, and sometimes IS absolutely wonderful, the reality is that because it chops the map into so many pieces in the name of flatness, you’ll often risk ending up with more seams than paintable objects. If you go this way – prepare for a lot of time spent (potentially needlessly) stitching, as there are other options – but your map will probably be a work of art.

  • LSCM mapping

LSCM stands for Least Square Conformal Mapping, which means that it uses an advanced mathematical formula/method to keep stretching and deforms to a minimum. After you’ve defined seams on your object, it will determine a way of mapping which will result in the least amount of distortion on your selection. You could potentially map a whole figure in one go with this method, but it usually gives better results to cut up your map, as it bases it’s calculations on an average, and an average of a smaller shell will give better results. You can always stitch the unwrapped pieces together for a bigger map to paint on. You can also get rid of distortion remnants by applying i.e some pelt mapping or relaxing it a bit.

  • Pelt Mapping

Pelt mapping gets its name from the way it maps – by taking the selected object, and stretching it as if it was in one of those contratptions in which one dried and stretched animal skins. Pelt mapping is primarily used on organic objects, like flora and fauna – it doesn’t demand as many seams to get it right like some of the other projections. Despite it’s speed and efficiency, it still generates some distortion when flattening, so you’ll often have to tweak via running a relax or manyally moving vertices.Note that sometimes the term pelt and LSCM mapping are used interchangeably, depending on the application

  • Camera

All selected faces will be planar mapped from the camera’s viewpoint. Which is great if you have a difficult map and a very simple still, but perpare for a lot of distortion in any area not facing the camera.


If you’re new to 3D, you  may find UV Mapping concepts and phrases yet another bowl of word-soup to deal with. Hopefully this little glossary will help translate some of them.

  • Overlap

Overlap is when you see that you’ve got two or more faces on your map partially or wholly overlaying eachother. In UV mapping it’s usually caused by the projection or the relax function in tight areas. No matter the cause, overlap is an issue for anyone texturing, as overlap means that the faces will share the same texture. You’d typically find overlap areas on heads, around the eyes and nose and the mouth, or on other organic models, where arms or legs meet torso. It’s fixed by either pulling the vertices manually, trying to add a limited relax to the area, or trying to give more space to unwrap by cutting a tiny seam

  • Seam

A seam in UV space is pretty much the same as a seam on your clothes, and unless you’re working on a flat plane, you”ll have at least one seam in your map.A seam is the edge which is left open after you’ve cut your edges. You can cut seams along any edge or edgeloop on your map, and bend, fold or break them, but if you want to help whomever is texturing, make sure they’re clean, within a reasonable amount, and in the least visible areas of your model. Seams also denote the outer boundaries of the pieces you cut and flatten for your map, called islands or shells:

  • Shells and/or islands

An island is a piece of map that you’ve cut – a collection of connected UV faces who’s outer borders (seams) connect to other islands. They can be as big and small as you like, but they should only overlap if you’re stacking. If you’ve got a big or complex model to map, cut your mesh into shells, unwrap them, and then stitch or weld them together again

  • Multiple UV maps

Sometimes you need extra space, or you’re working on a game(-mod) which uses component swapping, demanding you use multiple UV maps for your object. They are fairly simple to create, as most mapping applications have a “hide function”; Map your object, select the items you want on the first map (on a gaming figure, typically the head on one map, the body on the next), hide the other items, and save your map. Repeat for the next map, but unless your’re in need of extreme detail, two usually suffice. Just remember to put a legend or colour code on the map to make it easier to remember which map goes where.

  • Projection painting

If you haven’t had the time or opportunity to UV map well, or if you have problems with texture seams, projection painting is a method of painting directly on your mesh, calculating UV coordinates on the fly.

  • UV space

The grid you have in your UV mapping application isn’t just for show – it contains UV coordinates. If you stray outside of the grid, chances are parts of your texture will look distorted, as most applications only read what’s “inside” the lines. Try to economise your UV space by seeing how much you can stack, and how much needs to be unique on your texture – even if you know i.e three bolts will need a separate texture, it saves more space to stack the remaining 21 than having all 24 laid out

  • Topology

The terrain of the model if you will – just like with real maps, a UV map consists of the terrain of the mesh

  • Cut

After you’ve defined (selected) the edge across which you want a seam to run, most applications, standalone or native, will have a cut command, enabling you to cut islands on your map.

  • Weld

Welding or sewing bits of a map together. It’s often easier to unwrap into smaller pieces and then putting them together again

  • Flatten

To generate a non-distorted surface for the texturer to paint on via UV mapping

  • Stretching

There are several types of distortion one can see in a map. Stretching is caused by a small texture area being applied to large parts of the mesh. It’s fixed by tweaking the area on the map it’s been applied to.

  • Compression

This type of distortion is caused by a large texture area beibg applied to a small part of the mesh. Like Stretching, it’s fixed via tweaking manually or a relax function

  • Flipped UVs 

You get flipped UVs if something got turned the wrong way, either when modeling or during your mapping process. The best way to check for this is to have a UV grid with numbers or letters, as they will show mirrored in such areas. It’s fixed by flipping the orientation of the faces back to where they should be.


Few 3D packages ship without a native UV mapping function these days, but there are some apps which may help you work faster

UVLayout

Developer: Headus

Platforms: Win / Mac

Price: $300 (Professional), $200 (Hobbyist), $100 (Student)

Once you get your head around the interface, by far one of the best UVmapping applications around, for both hard edged and organic unwrapping. As it’s an LSCM mapper, it doesn’t have the array of projections available to other  applications, but once you start using it, you won’t really care about that, as it just does the job, and well. If you’re serious about good UV maps in your pipeline, this is the one you want.

(My personal favourite by _far_)

Website: uvlayout.com

 

Unfold3D

Developer: Polygonal Design

Platforms: Windows

Price: €299 (Network licence costs £600

If you’re looking for a fast solution, this may be it. Unfold 3D lets you define vertices, edges, faces and islands to unwrap, and takes it from there. It offers stretch optimisation which gets rid of stretch, and also packs your map for you. Some users may find that it hasn’t got enough options to tweak the UVmaps, but you can always tweak the parts you’re unhappy with in your native editor, if needed.

I reviewed Unfold 3D in 3DW 139, and used it to map the spaceship in the 3DW 148 scifi issue – I use it when Ii need stuff done, fast

Website: unfold3d.com

 

Ultimate Unwrap 3D

Developer: Unwrap 3D

Platforms: Windows

Price:$59.95 (Pro), $49.95 (Standard)

:Initially starting out LithUnwrap, a low-poly UV mapper, Unwrap 3D is a mapper favoured by many, as it offers most types of mapping and the kitchen sink in addition to an intuitive UI packed with handy functionality. Offers support for an incredible amount of file formats, extensive unwrapping and stitching tools, vector export of maps, pelt and LSCm mapping. Easy to use, easy on memory, and excellent support.

To me, this is the Swiss army knife of unwrapping tools- I usually use it to cut tangly groups and render out coloured shells, like the spaceship in 3DW issue 148

Website: unwrap3d.com

Leave a Reply