Sub topic 1
UV Maps and UV Space in a Nutshell
A 3D model is a hollow surface in three dimensions, but the textures you paint for it are flat images. A UV map is the lookup table that connects the two. This chapter gives you the working model of that table. The rest of the tutorial, including seams, unwrapping, and packing, builds on it.
Prerequisites
This chapter assumes you can do the following in Blender:
- Navigate the 3D Viewport and switch between Object Mode and Edit Mode.
- Select vertices, edges, and faces.
- Apply a texture image to a material at a basic level.
The Python snippets are optional. You need to be able to run a script from the Scripting workspace, and no deeper knowledge of the API.
What a UV map is
A UV map assigns each corner of each face in a mesh a 2D coordinate. When Blender renders a pixel on a face, it interpolates those 2D coordinates across the face and reads the texture color at the resulting point.
The names U and V are the two axes of that 2D space. They are called U and V so they are not confused with X, Y, and Z, which describe positions in the 3D scene.
Three terms recur throughout this tutorial:
- UV coordinate: a pair (U, V) stored for one face corner.
- UV island: a group of faces that are connected to each other in the UV map. Each island is one flat piece of the unfolded surface.
- UV map (or UV layer): the complete set of UV coordinates for one mesh.
UV space
UV space is the flat coordinate system the islands live in. Its properties matter for every later step.
| Property | Behavior in Blender |
|---|---|
| Axes | U runs horizontally, V runs vertically |
| Origin | Bottom-left corner of the image is (0, 0) |
| Main tile | The square from (0, 0) to (1, 1) covers the whole image |
| Units | Fractions of the image, not pixels |
| Independence | Island size and position have no link to the object's size in the scene |
Two consequences follow from the units. First, the same UV map works for a 512 px or a 4096 px texture, because coordinates are fractions. Second, the size of an island relative to the square decides how many pixels that part of the model receives. This is the basis of texel density, covered in a later chapter.
Islands do not have to stay inside the 0 to 1 square. Outside it, image textures repeat by default, and the tile at U from 1 to 2 shows the same image again. That behavior is useful for tiling materials. It causes problems for baking, where overlapping or out-of-range islands usually give wrong results. UDIM tiles, covered near the end of the tutorial, use the space outside the square on purpose.
UVs belong to face corners
This detail explains why seams work. Blender stores a UV coordinate for each face corner (called a loop in the API), not for each vertex.
A vertex shared by four faces has four corners, so it can hold four different UV coordinates. If all four agree, the faces stay joined in UV space. If they disagree, the surface is cut at that point, and the vertex appears in more than one place in the UV Editor.
A seam is an instruction to Blender to make the corners on either side of an edge disagree when unwrapping. Faces that are neighbors in 3D then end up apart in UV space. The next chapter explains why that cut is needed.
Because of this storage model, you can have a mesh with no cuts at all in 3D and still see it fall into many pieces in the UV Editor.
Multiple UV maps on one mesh
A mesh can hold several UV maps. A common reason is a second map, built for baked lighting, that has no overlapping islands, while the first map is tiled for the base color texture.
Each map has two flags:
- Active: the map you edit in the UV Editor and write to when you unwrap.
- Active Render: the map that the renderer and viewport use by default. A shader can also choose a map by name with a UV Map node.
You manage maps in Properties Editor > Object Data > UV Maps. The script below lists them. Run it with a mesh object active.
import bpy
mesh = bpy.context.object.data
for uv_layer in mesh.uv_layers:
print(uv_layer.name, "active:", uv_layer.active, "render:", uv_layer.active_render)A frequent source of confusion is editing one map while the shader reads another. If your texture looks wrong after an unwrap, check that the active and active-render flags point to the map you changed.
Reading UV coordinates from a script
Seeing the raw numbers makes the "per face corner" idea concrete. The following script runs in Edit Mode. It prints the UV coordinate of every corner of each selected face.
import bpy
import bmesh
obj = bpy.context.edit_object
bm = bmesh.from_edit_mesh(obj.data)
uv_layer = bm.loops.layers.uv.active
if uv_layer is None:
print("This mesh has no UV map")
else:
for face in bm.faces:
if face.select:
for loop in face.loops:
uv = loop[uv_layer].uv
print(face.index, loop.vert.index, round(uv.x, 3), round(uv.y, 3))Select two faces that share an edge, then run the script. If the faces are joined in UV space, the two shared vertices print the same UV coordinates for both faces. If a seam lies on that edge, the same vertex index prints with different coordinates. That difference is a cut.
Why not just project the texture?
You can map textures without a UV map. Box, sphere, and flat projections compute coordinates from 3D position at render time. They work for simple shapes and for noise-like materials. They fail when you need to paint or bake details that follow a specific surface, such as a scratch on one panel, a face on a character, or a label on a bottle. A UV map is stored with the mesh, so the paint stays attached when the model is posed or moved.
What makes a good UV map
The goals are the same for every model, and the chapters that follow are organized around them:
- Low distortion. A square on the surface should stay close to a square in UV space. Stretching blurs or smears the texture.
- Useful cuts. Seams should sit where they are hard to see, and where the shape naturally folds.
- Consistent scale. Equal areas of the surface should receive a similar number of pixels.
- Efficient use of the square. Islands should fill the 0 to 1 area with small, even gaps so few pixels are wasted.
- No unwanted overlap. Islands should not share the same area, unless you mean to reuse the same pixels, as in mirrored parts.
These goals can pull against each other. Fewer seams mean less visible cutting but more distortion. More seams mean flatter islands but more edges to hide and more places for texture to mismatch. Most of the work in UV unwrapping is deciding where to settle between them.
A first look in Blender
To see all of this yourself, follow these steps:
- Add a default cube and press Tab to enter Edit Mode.
- Switch to the UV Editing workspace. The left side shows the 3D mesh, and the right side shows the UV Editor.
- Press A in the 3D Viewport to select all faces. The cube's default UV map already appears as a cross of six squares inside the square tile.
- Select one face in the 3D Viewport. Only that face's square is highlighted in the UV Editor, because the selection is synced between the two views by default.
The default cube is already cut along its edges. Those cuts come from the cube's primitive UV layout, not from seams you marked. In the next chapter you will see why a closed surface needs such cuts at all.
Exercise
A vertex is shared by three faces. In the UV Editor, it appears at two different locations. How is that possible, and what does it tell you about the mesh?
Show answer
UVs are stored per face corner, not per vertex. The vertex has three corners, one per face, and they can hold different coordinates. Two locations means some corners agree and some do not, so the surface is cut at that vertex. Along the edges between the faces whose corners differ, the surface is split in UV space, which is the effect of a seam or of the original UV layout.
Exercise
You unwrap a model and bake a texture, but the result looks wrong in a few places. In the UV Editor you notice two islands lying on top of each other and one island that extends past U = 1. Why are these likely causes, and what is the safe layout for baking?
Show answer
Overlapping islands share the same pixels, so the bake writes different surfaces into the same area, and the last one wins. An island outside the 0 to 1 square is baked onto a different tile, or is clipped, depending on the setup. For baking, every island should lie inside the 0 to 1 square with no overlap, unless the overlap is deliberate, such as mirrored parts that share identical shading.