Unwrapping

This next concept is probably one of the most time consuming parts of creating a 3D model. There are many ideas that you will need to understand in order to grasp the main ideas. We will begin this section with some background concepts then go on to the the process of unwrapping a model

Background

Unwrapping is the process of assigning texture coordinates to the faces of a mesh. A texture coordinate is consists of two values (u,v)(u,v) , typically called a UV Value. For each vertex of a face, there exists a UV value that indicates the coordinate of that vertex on the texture. UV coordinates range from 0 to 1. 0,0 is the bottom left corner and 1,1 is the top right corner. Note that in some systems UV coordinates define 0,0 as top, left and 1,1 as bottom right. It is fairly easy to convert the coordinate systems from one form to the other but be aware that this could happen.

Note the mapping between the vertices of the faces A and C and their UV vertices. Note how the image is applied within the two areas. One way to think about how it works is this: cut out the texture according to the outline of the face, then taking that piece of texture and pin it to the mesh according with the corresponding vertices, stretching the image to cover the face.

Stretching of the texture

If you look at the above image, you will notice that the image of the hamster in faces A,B D and C seem to be stretched (not proportional... for example, the eyes in the texture are less round (more tall ovals) than the eyes on surface of the surface of the mesh. This has to do with the stretching that occurs when the texture is applied. The shape for A in the mesh is more "square" like than the shape of A in the texture, which looks more like a tall rectangle. Thus, in order to fit the texture, the image had to be stretched horizontally to fit the mesh shape and thus the image looks wider than the texture.

In general we want to avoid this type of stretching where we make the image look look disproprotionally stretched. If we want to proportionally enlarge an image its fine but we want to avoid only stretching it more one way (horizontally in this case) than the other (vertically in this case).

Texture Space Utilization

A texture used in games is typically a power of two square image. (256 X 256, 512 X 512, 1024 X 1024 etc). The UV coordinate system maps the faces onto the texture proportionally so the final size of the image doesn't matter. For example if a uv vertex was at (0.5, 0.5) (ie middle of the texture), then that vertex would be at pixel (128, 128) on the 256X256 image and (512,512) on the 1024X1024 image. Thus what we want to do is maximize the usage of the entire texture space as much as possible. larger images will give us sharper images but with good techniques we can make use of as much of the texture space as we have.

Last updated