Sub topic 10
Keeping texel density consistent
This chapter assumes you can mark seams, unwrap a mesh, and read the UV Editor. It also assumes you can check distortion with a checker texture. If a UV island is still stretched, fix that first. Density only makes sense on islands that are not distorted.
What texel density is
A texel is one pixel of a texture as it lands on a surface. Texel density is the number of texels per unit of surface, such as pixels per meter. Two faces with the same world size should get the same share of the texture. If one gets four times more UV area, it looks sharper than its neighbor, and the difference shows as a change in detail.
Blender gives each island an arbitrary size after unwrapping. Unwrap sizes depend on the island's shape and on the algorithm, not on how big the face is in the scene. A small bolt can end up as large in UV space as a whole wall. The result is a model where some parts are blurry and others waste texture space.
When density must match
Consistency matters most when parts share a material or sit next to each other. A character's head and hands should look equally detailed. A modular wall kit needs matching density so a painted brick pattern has the same scale on every piece.
Density can differ on purpose. A hero prop seen up close deserves more texels than the underside of a table. Treat consistent density as the default, and give extra area only where it pays off.
Measuring density
Blender has no built-in density readout in the UV Editor. You can judge it in two ways.
- Visual check. Assign a checker texture, as in the distortion chapter. Squares should look the same size across the whole model. Large squares mean low density and small squares mean high density.
- Numeric check. Compare each face's UV area with its 3D area. The ratio, scaled by the texture size, gives texels per unit.
The following script prints the average density of the active mesh. It assumes a 2048 px square texture and a mesh with an active UV map.
import math
import bpy
import bmesh
TEXTURE_SIZE = 2048
obj = bpy.context.edit_object
bm = bmesh.from_edit_mesh(obj.data)
uv_layer = bm.loops.layers.uv.active
total_3d = 0.0
total_uv = 0.0
for face in bm.faces:
if not face.select:
continue
# Face area in object space, scaled by the object's world scale.
scale = obj.matrix_world.to_scale()
area_3d = face.calc_area() * abs(scale.x * scale.y * scale.z) ** (2 / 3)
uvs = [loop[uv_layer].uv for loop in face.loops]
area_uv = 0.0
for i in range(len(uvs)):
a = uvs[i]
b = uvs[(i + 1) % len(uvs)]
area_uv += a.x * b.y - b.x * a.y
area_uv = abs(area_uv) / 2.0
total_3d += area_3d
total_uv += area_uv
if total_3d > 0 and total_uv > 0:
density = math.sqrt(total_uv / total_3d) * TEXTURE_SIZE
print(f"Average texel density: {density:.1f} px per unit")
else:
print("Select faces with a valid UV layout first.")The square root converts an area ratio into a linear measure. Run it in Edit Mode with the faces you want to measure selected. The scale term handles objects with uniform scale. Apply scale with Ctrl+A before you rely on the result, because non-uniform scale makes any density figure unreliable.
Equalizing density in Blender
You can fix density with tools that ship with Blender.
Average Island Scale
In the UV Editor, select all islands and choose UV > Average Island Scale. Blender rescales each island so its UV area is proportional to its 3D area. After this, a face that is twice the size in 3D occupies about twice the UV area. This is the main tool for this chapter, and you will use it on nearly every model.
The operator has no options that matter for most work. Check that UV Sync Selection is off, or that every island is selected. Unselected islands keep their old size and break the balance.
Why Average Island Scale also changes packing
Scaling islands changes how much of the 0 to 1 space they fill. Run UV > Pack Islands afterward. The packer can scale all islands together to fill the space, which preserves their relative sizes. Density is then equal across the model, but the absolute value depends on how well the layout fits.
The following script runs the whole sequence on the active mesh. It uses the operators from the earlier unwrap example.
import bpy
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.uv.select_all(action='SELECT')
bpy.ops.uv.average_islands_scale()
bpy.ops.uv.pack_islands(margin=0.02)
bpy.ops.object.mode_set(mode='OBJECT')Selecting UVs with uv.select_all matters when UV Sync Selection is off, because the scale operator acts on selected UVs.
Giving some parts more density
After you equalize everything, scale up the islands that need detail. Select one island, scale it with S in the UV Editor, and repack. Scale by a clear factor, such as 1.5 or 2, so the choice is intentional and easy to remember. Document the factors if the model goes to other artists.
A related choice is how to treat hidden surfaces. The inside of a closed box or the underside of a shelf is rarely seen. Scale those islands down to 0.5 or lower. This frees space for visible areas without touching the visible parts' relative density.
| Part of the model | Typical scale after equalizing |
|---|---|
| Hero surfaces, faces, hands | 1.5 to 2 |
| Standard visible surfaces | 1 |
| Rarely seen areas | 0.5 |
| Hidden interior faces | 0.25 or delete the faces |
Edge cases
- Mirrored or overlapping islands. Overlapping UVs share one patch of texture. Average Island Scale treats them as separate islands, and the pack step may then separate them. Keep mirrored islands out of the selection if you want them to overlap, and scale only the unique halves.
- Very thin islands. A long strip of faces has a high area ratio in one direction and a low one in the other, which means it is stretched. Fix the distortion before you trust the area-based scaling.
- Non-square textures. A 2048 by 1024 texture stretches a square UV layout. Blender's UV space is always 0 to 1 on both axes. Make the image non-square in the Image Editor to preview the effect, or keep textures square.
- Multiple UV maps. Operators act on the active UV map. Check which map is active in Object Data Properties before you scale.
- Multiple objects. If several objects share a texture, select them all in Edit Mode together. Average Island Scale then balances the islands across objects. Run it per object and the objects will not match each other.
A working order
- Apply object scale.
- Mark seams and unwrap.
- Check distortion and fix it with pinning or extra seams.
- Select all islands and run Average Island Scale.
- Adjust individual islands for importance.
- Pack with a margin.
- Check the checker texture again.
The order matters. Packing before you equalize makes the packer fit islands that you then resize, which breaks the layout.
Exercise
A modeler unwraps a character with a separate belt object that is scaled to (3, 3, 3) in Object Mode and not applied. After Average Island Scale and packing, the belt's checker squares look three times larger than those on the body. What went wrong, and how do you fix it?
Show answer
The unwrap and the area-based scaling used the belt's mesh data, which does not include the object scale of 3. The belt looks three times larger in the scene, so its squares appear larger and its real density is lower. Apply the scale with Object > Apply > Scale on the belt, then run Average Island Scale and pack again, with the body and belt selected together in Edit Mode.
Exercise
Why should you run Pack Islands after Average Island Scale, and not before?
Show answer
Average Island Scale changes the size of every island. A layout packed beforehand no longer fits, so islands may overlap or leave gaps. Packing afterward fits the final sizes and keeps their relative scale, so density stays equal.