Unwrap Theory & Technique:
  Unwrap Theory
  A trick that helps 3d artist make something appear more real is to apply color to the model. This is done by the use of a Shader. Shaders are algorithmic code that cast a value of RGB (Red,Green,Blue) on the 3d model and applies effects of how light interacts with the color, direction the polygon is facing, and relative position of the viewer or camera. Other effects can also be applied that can effect how the light affects the color of the polygon but takes time to calculate these procedural textures. However for games this needs to happen in real time, as the gamer will not wait not even a nanosecond for it to render. So a way around this is to apply a simple color map that acts like all the procedural textures by creating a illusion of the material, color, and how light interacts with it. This method of faking the procedural texture is often referred to as Texturing the 3d model.

  The process of texturing your 3d model starts with flattening the model so that you can apply a Two-Dimensional bitmap to the faces. The flattening process is referred to as unwrapping the UVW’s or just plainly as ‘Unwrapping’. These UVW is the coordinate system that is equivalent to the XYZ coordinate system you find in your 3d application, as the UVW’s are the representation of your polygon faces. So whatever you put in to the space of the triangle in the UVW space, a corresponding triangle on the actual model will receive that image as if it was being projected on.

figure 4-01
  The inherent problem with this process as you will see is that you are applying a square pixel to a shape that may not be squared but rather a triangle. Remember, at render time everything becomes a triangle. So when unwrapping you could straighten things out but this may introduce stretching. Stretching makes the pixels look skewed or distorted on a polygon face, which you will find undesirable or look horrible. You can also get texture pinching as a result as well. Texture pinching is when you get several pixels on a triangle side’s compared to one of its other sides. So what you have is more pixels in one location compared to the other on the same face. You want the pixels to flow across the surface of the model as evenly as possible.

  If this isn’t complicated yet, you want as much pixel’s per inch, meaning you want as many pixels on each face as you can possible get on a polygon face. To do this try to get as many right angle triangles as possible in your model. Avoid triangles that give you less the 5 degrees in a corner. The reason is that the Shader has a difficult time trying to figure out where the pixel goes and it might bring more or push pixels in and out on to the polygon face. Plus you want to get the edges in the unwrap as straight as possible vertically or horizontal as pixels run in that fashion.

figure 4-02   figure 4-03

  If you unwrap it correctly or as good as you can get then you can avoid stretching. Stretching is the result of a poor unwrap or improper size map. Stretching is when a polygon face has very few pixels for its size, so it must scale up the pixels it has to fit the surface in the unwrap you assigned to it. Which will result in noticeable stair stepping situation. To avoid this, avoid the following:


  Wasted space, this is where pixels are being assigned to nothing on the model. The more wasted space you have the more scaling up the Shader has to do resulting in noticeable stair stepping.

  Texture map size is too small for the model. If you’re trying to define the surface of a human face with a 16x 16-pixel face you should expect some very noticeable pixelation on the face.

  Bad Geometric flow can result in stretching. If there are a ton of Triangle B type triangles throughout your model then this can create some stretching issues. The longer the triangle the worse it will be.


  Unwrap Technique
figure 4-10
  The best way to describe UVW Unwrapping is that it’s a puzzle game or it’s just like a Jigsaw Puzzle ranging from various size and shapes except with no colors. I’ll show you Unwrap UVW by unwrapping this low polygon bug.

  As I explained earlier UVW stands for the XYZ coordinates of your model but is the representation of the shapes faces. Now the thing here is that you’re flattening the model out in to a 2D image. You’ll need to do this flattening in order to paint on the texture using a none 3D program like Photoshop (gear towards photo editing) or Corel Painter (geared towards painting and creating images). The coloring or "painting process" is a tutorial all on to its self.

  I’m for the most part, I'm a Max guy. So I’ll show you the Max way, as that is the way I know, best. Now just recently I have discovered a few new plugins that will hopefully make this process much faster. But I will show you the toolset that Discreet gives, despite that its out dated and time consuming. Regardless the main stages should remain the same, the individual steps and toolset might change.

      Download: Sectid_queen.zip

  Opening the Edit UVW window:

  You need to get to the Unwrap editor, so you can start the unwrapping process. Make sure everything is assign right and assign the stuff you need to assign to the model, then we can cover the separating the pieces to get it so that you can start working with the unwrap.

figure 4-11
  Step 1: Load up your model or download the model above to follow along.

  Select your model and I recommend you convert it to “Editable Mesh”. The reason why is that I've always got some unexplainable weird warping that looks like waving pixels if I unwrapped it in Editable Polygon. Now I will turn all my hidden edges on so I can see all my triangles. This also helps other applications relax better so you should get used to this step. It saves you more headaches then what it will create.

figure 4-12
  Step 2: Now go to the Modify panel and to the drop down box to select “Unwarp UVW”. In Max this adds the Unwrap UVW modify to the stack box above the mesh. This means you can turn the effect off and edit the effect. An important feature here is the plus sign. Click on it to open up the modifiers features much like you can for editable mesh and polygon. Click on “Select Face” to highlight it in yellow. This will allow you to select the face in the views and it will select the corresponding face in the Unwrap editor. Why this is not set to on as default or why you would want it off in the first place is beyond me.

  Step 3: In the Modify Panel, in Unwrap UVW is a bunch of roll outs. As long as the whole mesh is set to one material ID you can edit the whole thing. Default material ID is 1 unless you change it. But we want the Unwrap Editor. Click on the button under parameters called “Edit…” This will open a floating window and that’s your Unwrap editor.

  At this time I would like to point out a few more options left behind in the Unwrap UVW toolset. The “Planar Map” button works by taking the select faces and taking a snap shoot of them based on the Params that is selected above the button. Some people will use this to unwrap their model. Also under that is the Display options, here you can control the thickness of the lines that shows your seams on the actual model. The options are pretty self-explanatory.

figure 4-13
  Step 4: With the Edit UVW’s window open you will probably need to resize it. In fact you will always have to resize it every time you open it. But let me walk you around this window as Discreet does a very poor job at explaining things.

  First off you should see a big mess and a blue grid in the background. This grid is for orientation, but take note the thicker lines (you might not see them at this time but they are there). This is where the texture if any would be applied to, then it would tile out way from this point. The thick blue line indicates the main UVW space. This is where the UVW triangles will have to be placed in order to get pixel information assigned to the corresponding face on the mesh. Though you can have them outside this area but you could get the wrong pixel information assigned to the wrong face. For all extensive purposes try to keep inside the lines.

  The white, green, and red lines are your models edges. Except everything is a complete mess. Don’t worry we will be sorting all this out soon. White edge stand for continues edge, or connected edge. Green means open edge, if it’s not white then it’s green. Red is what you have currently selected.

figure 4-14
  On the top menus you need to checkout Mapping. Under here are the two features I like Flatten which flattens quickly but requires a little work to bring things back together. The other is Normal Mapping as it allows you to Planar project Back/Front views, Left/Right views, Top/Bottom views, and Box mapping which is similar to UVW Map:Box.

  Next in the menu tool is another very handy option, Under Display is the Show Vertex Connections. This allows you to see where each vertex and its corresponding split vertex’s are. When you break a vertex or when it breaks it creates a double vertex that shares the same vertex ID. This way you can separate the faces and edges apart without much of a hitch. When turning on this option you see the actual vertex ID being displayed next to the vertex. This will let you find all of vertex 5 by marking them all with the number 5 next to them all.

  Next take note of the five select icons below the main menu. From left to right, Move (with left/right and up/down only as pop outs), Rotate, Scale (with left/right, up/down only as pop out), Freeform Mode which does all three previous depending on where you have your mouse, Mirror Horizontally (with Vertical mirror, Flip horizontal, flip vertical as pop outs).

figure 4-15
  Near the bottom are several more tools I want to guide your attention too. One of them is call “Filter Selected faces” and looks like a triangle. This tool is sometimes hidden as you will have to stretch your window out to get it is right next to the Material ID selection box on the bottom. Next are the Selection Modes. They are Vertex, Edge, Face with + to add to the currently selected and – to subtract from the current selection. Next are the Rotate +90 and Rotate –90.

  As for short cuts there is Hold middle mouse button and move mouse is move screen like panning, Scroll wheel is Zoom in and out. Ctrl+t is target weld, and Ctrl+b is break. However the command you will end up liking is Stitch Selected. The only way to this is through the top menu under Tools or by right clicking to get the quad menu. However you wont get the options which you need to reset the Bias. So you will need to go through the top menu at least once. I usually set the Bias to 0 then hit “Set as Default” to keep that setting. Then I go through the quad menu and stitch away but later I will tell you how.

  In Freeform Shift+left click in the select shape and move mouse is Move left/right only or up/down depending on where you move the mouse based on where you original left clicked at. By moving the mouse over the solid box corners like in Adobe Illustration you will get the scale tool. Shift+Left click works here as well to restrict the scale tool like it did for the movement tool. Rotate is the outlined box in the center of each edge of the marquee box.

  Now you should be a little familiar with the window I hope.

  Separating the unwrap parts:

  Now that we got the Unwrap Editor open we can now start separating the faces. The key here is to move the faces away from the main UVW space by placing the faces outside the thicker blue lines. You want to break things down in to their elements like legs go to this area, arms go here, and chest goes here. You get the idea. So we need to separate this mess. But before you start to break things down, this is where you will eliminate geometry so you don’t waste time dealing with it. But I’m not going to cover what geometry to get rid of until later during the grouping and reconnection process. For now I’ll assume you need to unwrap all the geometry.

figure 4-16
  Step 5: So breaking stuff down or deconstruction is fun. I recommend turning on face mode at the bottom of Unwrap Editor and select the faces you want to start separating the elements apart. There are several methods of going on about doing this. But you want to do the fastest and quickest way about getting it done as soon as possible.

  We want to clean off the main area in the Unwrap Editor so with face mode selected highlight all the UVW's and move them off to the side as a group. You might have to zoom out in the editor to see the space in the surrounding areas around the main area of the thicker blue lines of the grid.

  Select the bugs body faces in the main area back in one of the viewports, with Select Faces on the corresponding face in the Editor gets selected. Use the + and – under the Selection Parameters in the command panel to expand your selection or subtract from it. If you use the one in the Editor it won’t expand to include all the faces in the element, as they may not be all connected there.

  Step 6: Switch the Sub Object Params option to ‘Z’ off from Averaged Normals and hit the Planar Map below. This arranges the capture like a snapshot based off the Z coordinates compared to the majority of the selected face direction. You can try the others and see what you get. Y should get you a snap shot from the side of the bug. X should get a snap shot from the face of the bug with body behind it.

  Step 7: Once its been Planar mapped with the Z option move the faces off the side and continue to do the above until all geometry has been planar mapped. You should notice in the image above that I don't use the Z setting but I want to point what happens when you don't. Everything isn't as straight as it should be and means you'll have to straighten it out, adding more work and extra steps. Avoid that and use the Sub Object Params: Z setting.

  Grouping and reconnecting the groups:

  This is where we have like objects together. The legs with the legs, etc… We need to either stitch them together to bring them together as one or we need to overlap and relax stuff.

  Now I have covered pixel per inch so here is a trick that will allow for more pixels per inch. Overlapping similar elements will give you extra space especial when those elements don’t have any unique pixel information. By overlapping the bugs legs you don’t have to waste space in the unwrap to cover the same pixel information over again. Instead the same pixel gets applied to each leg in the same spot. Now this will create a repetition or a repeat of the color information on the actual model, but the advantage is more extraordinary. Saved space in the unwrap means more pixels per face and smaller texture size.

  Overlapping is a good trick to save space but there are drawbacks of overlapping. This technique can’t be done with Normal maps because of the way they work and calculate. What happens when you do this is that the Shader gets confused on which direction the pixel is to face cause a pixel direction issue. Another problem with overlapping is that it creates seams. Depending on if you hate having seams or a break in the pixel texture on the model then you will want less seams as possible so overlapping all similar elements would not be an option for you. But the advantages are huge in that you will save tons of unwrap space and can make the texture size smaller.

  Step 8: Connecting pieces back together requires several tools that are Stitch Selected edge, Target Weld, and Weld.

  Stitch Selected works best with edge only. When you select an edge which will turn red the corresponding edge will turn blue. This red and blue relationship indicates to you that this is the same edge on the actual model. When using stitch keep in mind this, the Blue edge and all its connected faces will move to the Red edge and Blue edge will weld to the Red edge. This will make the Blue edge take on the length and position based on the tolerance set in the Stitch Selected options.

  Target Weld is always nice to have when you need to connect something that you want to take on the place and position of another vertex. This will move the first vertex in to the second selected vertex and will stretch the lines and face to incorporate this new position.

  Weld works great when you use it to connect pieces back together. Make sure you use Show Vertex Connections and position the section with the matching section. Figure out where the average would be on both shapes and try to match them up, some vertex will not match but your going for the average. Then weld away. At the bottom of this tutorial is a link to a site that has some great video tutorials. I highly recommend them.

  However this tutorial doesn't really use these tools above as the model isn’t that complicated to warrant their use.
figure 4-17
  Step 9: But lets focus on Relaxing stuff now.

  Relax may involve another program. Discreet doesn’t have a very good relax command script as it doesn’t base its relax off the neighboring faces and how much surface space the actual face has. So you might want to get another program to do this. Headus UVLayout has a good relax, as does DeepUV.

  I’m not going to show you how to export this and relax with another program but I’ll show you how to manually relax something. The area we need to relax is near the end of the bugs body. Switch to edge mode in the editor and select the line in question you might have to select and select again but eventually you’ll get the right line. Then move the line and hit and hold shift to constraint it a left/right or up/down and move the line to the right. Now this will introduce some stretching but as long as we don’t move it to far. If you don’t mind having a seam here at the edge you can select the two faces, break them and remap them with a Mapping>Flatten command.

figure 4-18
  Step 10: Lets overlap the legs. You can go about this in two ways. The painstaking scale each vertex to each one and position them just right on all six legs. Or you can use mirror/copy and delete the unneeded geometry and attach the mirror geometry. We’ll do the last as the first one we will do in a small amount in the next step.

  So close the unwrap Editor, and collapse the stack by converting it into another Editable Mesh. Now select the one side of the bugs faces that are the right or left side legs and the same side wing and antenna.

  With them selected, delete them by hitting the delete key. Now reapply your Unwrap UVW again and go back to the Unwrap Editor and the faces are gone cleanly with no weird missing parts even though you wouldn't get it. But sometimes if deleting faces and leaving neighboring faces you will get some weird issues. By collapsing the stack you avoid this issue so get in the habit of doing it.

figure 4-19
  Step 11: Now we want to overlap all the legs. Move the one-leg vertices in to a position that you can understand. Now move the second legs vertices close to the position of the first ones match them up one at a time then do the same for the third leg.

  Once this is done go to the scale tool and marquee select one of the clusters of vertices and scale them down by switching to just the scale tool to get uniform scale. This will pull them on average between all the selected vertices to a central point bring them closer together. Once you get them as close together as you think you will need do the same for all the other clusters but you will want to scale them on constraint path. To do this in either the scale tool or go back to the Freeform tool and hold shift and move the scale tool along the direction you need to scale them in too.

figure 4-20
  Step 12: Now we need to re-add what we got rid of. Collapse the stack again back in to a editable mesh. This will allow us to edit the geometry with no consquence in alternating the UVW’s. Now Mirror over the X with a copy. With the copy selected delete out the body of the bug and one side that you didn’t delete out on the original. Now use the attach command to attach the original geometry to what’s left. Then reapply you Unwrap UVW and you should have a successful unwrap with some time saved from not have to manipulate all those vertices.
  UVW layout arrangement:

  Now you want to create some good arrangement with you UVW’s. First, we need to consider how this bug will appear in game. It’s for a top down viewed game; in fact you will never see the bottom of the bug. So any bottom texture or geometry would be a waste, hence why it has none. From the top you can see you have several sections or parts of the body Head, Thorax, and Abdomen. Well the abdomen is the biggest section here, as it’s also the biggest section on the actual model itself. Due to its size it should take up the most space in the unwrap. The abdomen should get the most pixels you can squeeze into it, but with it attached to the thorax and the head you wont be able to fit it all in the square very easily and in the end you have a lot of wasted space. Since there would be a natural segregation between the thorax and the abdomen we can split the body here as well. There would be also one between the head and thorax as well. These natural segregations is where the two outer shells would meet creating a crease in the body armor. So any seams created here in the texture would appear kinda naturally. On human skin there is no such thing as seams, so any seams would be bad, but unavoidable. So you try to minimize noticeable seams by placing them where skin meets clothing or out of view of the gamer like under the arm or in areas that naturally fold. Below are some unwraps of the same bug, take note of what they will be good for and what’s bad for them.

figure 4-21   figure 4-22
     Poor unwrap   Normal map unwrap, 1 seam
figure 4-23   figure 4-24
     None Noraml map unwrap, 3 seams   None Noraml map unwrap, 1 seam
  For Normal mapping you don’t want to overlap what so ever, but its good use of texture space if you do overlap. So if your not using a normal map then your unwrap should sort of reflect the last row of examples depending if you want seams or hardly none at all.

  Now I highly recommend that to expand your knowledge on unwrapping and visit a great site that has some really good video tutorials. Just a warning that these video’s are about 200MB in size and will take awhile to download but its worth it if you can get them. Why learn from a novice when you can learn from a master. Oh sorry, am I now speaking with a bunch of…


  Visit his tutorial section. Ben has some great instructions and knowledge.


    Back to the Main Tutorial Page
3D Gallery   2D Gallery
Tutorials   Résumé   Contact
Copyright © 2002-2004 by Jeff Jonaitis. All Rights Reserved.
Best viewed in 1024 x768+ @16m colors; With IE 5+ Ns 7+