Sub topic 5
UV layout, texel density, and texture resolution
This chapter assumes you can unwrap a mesh with seams, use the UV Editor, and know that a bake writes pixels into an image through the low-poly mesh's UV map. The bake can only be as good as the layout it writes into. A poor layout produces blurry detail, wasted pixels, or corrupted results that no Bake panel setting can fix.
What the baker needs from a UV map
Cycles looks up each pixel of the target image by its UV position. It finds the low-poly surface point at that position and casts rays toward the high-poly mesh. This leads to four requirements:
- Every face you want baked must have UVs. Faces without UVs have no pixels to write to.
- Islands must stay inside the 0 to 1 square. Anything outside is not in the image. Do not use UDIM tiles unless you bake into a tiled image deliberately.
- Islands must not overlap. Two faces that share a pixel compete for it, and the last one baked wins.
- Islands need gaps between them. The gaps hold the margin, which is covered in a later chapter.
The baker uses the low-poly object's active UV map, the one highlighted in the Object Data properties list, not the one with the camera icon. If the mesh has several UV maps, check which one is active before you bake.
Mirrored and overlapping islands
Stacking the left and right halves of a symmetrical object on top of each other doubles the effective resolution. For a baked map this is risky.
- Normal maps. Mirrored islands work in tangent space only if the high-poly surface really is symmetrical at that spot. Any asymmetry, such as a scratch on one side, is written twice into the same pixels, and one side loses.
- AO maps. Occlusion depends on neighboring geometry. Mirrored islands are correct only if the surroundings are also symmetrical.
For the baked maps, use unique, non-overlapping UVs. Overlap is a technique for tiling textures, not for bakes.
Texel density
Texel density is the number of image pixels that cover one unit of surface in the 3D scene, usually pixels per meter. Two islands with different densities show the same detail at different sharpness. If one side of a prop has 3 times the density of another, the lower-density side looks soft next to it.
The aim is consistent density across all islands that the viewer sees at similar distances. Hidden or small parts, such as the underside of a crate, can use less.
In Blender, you can even out density in the UV Editor. Select everything, then use UV > Average Islands Scale so that each island is scaled in proportion to its 3D surface area. Then pack with UV > Pack Islands. The pack operator can also scale islands to fill the square. For a manual check, the table below gives the density of a 2 m by 2 m wall that occupies the full 0 to 1 square.
| Resolution | Pixels per meter on that wall |
|---|---|
| 512 | 256 |
| 1024 | 512 |
| 2048 | 1024 |
| 4096 | 2048 |
Real objects never fill the square perfectly. Gaps and unused corners lower the density you actually get.
Measuring texel density with a script
You can compute the average density instead of guessing it. This script uses the mesh's total surface area and total UV area. It assumes the object's scale is applied (Ctrl+A, Scale), because otherwise the surface areas are wrong.
import bpy
import bmesh
from math import sqrt
def uv_polygon_area(face, uv_layer):
pts = [loop[uv_layer].uv for loop in face.loops]
total = 0.0
for i, (x1, y1) in enumerate(pts):
x2, y2 = pts[(i + 1) % len(pts)]
total += x1 * y2 - x2 * y1
return abs(total) / 2.0
def texel_density(obj, resolution):
bm = bmesh.new()
bm.from_mesh(obj.data)
uv_layer = bm.loops.layers.uv.active
if uv_layer is None:
bm.free()
raise ValueError(f"{obj.name} has no active UV map")
surface = sum(face.calc_area() for face in bm.faces)
uv_area = sum(uv_polygon_area(face, uv_layer) for face in bm.faces)
bm.free()
return resolution * sqrt(uv_area / surface)
obj = bpy.data.objects["Asset_low"]
density = texel_density(obj, 2048)
print(f"{obj.name}: {density:.1f} pixels per unit at 2048")Run it in Object Mode from the Scripting workspace. The result is the average density in pixels per Blender unit. If one unit is one meter, it is pixels per meter. The result is an average, so it does not tell you whether individual islands are uneven. For that, check visually, as described below.
Choosing a resolution
Pick the resolution from how large the object appears on screen, not from how detailed the sculpt is. A detailed sculpt on a small prop still needs only a small map.
| Resolution | Typical use |
|---|---|
| 512 | Small props, distant objects |
| 1024 | Mid-size props, mobile targets |
| 2048 | Hero props, characters, most desktop assets |
| 4096 | Large hero assets, close-up cinematics |
Memory grows with the square of the side. An uncompressed 8-bit RGBA image is 16 MiB at 2048 and 64 MiB at 4096. Mipmaps add about one third more. Engines compress textures, but the ratio is still quadratic. Doubling the resolution quadruples both the memory and the bake time. Start at 1024 or 2048, check the result, and increase only if detail is visibly lost.
Square, power-of-two images (1024, 2048, 4096) are the safest choice. Many engines require them for mipmaps and compression. Non-square images are allowed, but the UV layout must then be stretched to the image's aspect ratio, or the texel density differs between horizontal and vertical directions.
Packing and spacing
Leave enough space between islands for the margin you plan to use. If you bake with a 16 pixel margin on a 2048 image, the margin is 16/2048, about 0.008 in UV units. Islands closer than that bleed into each other. The Pack Islands operator has a margin setting in the same unit, so you can set it from the pixel count.
import bpy
resolution = 2048
margin_px = 16
# Run in Edit Mode with all faces selected and the UV Editor available.
bpy.ops.uv.select_all(action='SELECT')
bpy.ops.uv.pack_islands(margin=margin_px / resolution * 2)The factor of 2 leaves a full margin on each side of the gap between two islands. Edge gaps to the border of the square should also be at least the margin. Packing is deterministic enough to repeat, so you can re-run it after a resolution change.
Straight island edges that run parallel to the pixel grid bake with less stair-stepping. Straighten long edges in the UV Editor when you can.
Checking the layout before you bake
Add a UV Grid or Color Grid test image to the material (New Image, Generated Type) and look at the object in Material Preview. Look for these signs:
- Squares that change size between neighboring faces mean uneven density.
- Squares that look like rectangles mean stretching, and stretched UVs distort a tangent-space normal map.
- A seam where the pattern jumps is expected, but it should sit at a hard edge or a hidden spot.
You can also turn on Stretch in the UV Editor overlays, which colors faces from blue (no distortion) to red (heavy).
Exercise
A 2 m by 2 m wall uses its UV island to fill 50 percent of a 2048 by 2048 image. What is its texel density in pixels per meter? What resolution would double the density with the same layout?
Show answer
The UV area is 0.5 of the square and the surface is 4 square meters. Density is 2048 x sqrt(0.5 / 4) = 2048 x 0.3536, which is about 724 pixels per meter. Doubling the density needs twice the pixels per side, so 4096, at four times the memory.
Exercise
You pack two mirrored halves of a character on top of each other and bake a normal map. One half has a scar on the high-poly mesh and the other does not. What happens, and what do you change?
Show answer
Both halves write into the same pixels, so the scar either appears on both sides or on neither. Give each half its own non-overlapping island, then re-bake.