UV Unwrapping

Welcome to 3D novas post. In this post we will talk about how to UV unwrap complex objects with clean UV grids, good for game engines, and the rules of UV unwrapping. 


What is UV unwrapping? UV unwrapping is pretty important step when it comes to texture painting. Imagine trying to lay a wrapped box completely flat on a table: to do that, you have to peel off the wrapping paper, unfold its corners, and spread it out. You have to cut the paper somewhere first so you can draw or texture a design on it. In simple words a UV unwrap takes the surfaces of your 3D mesh and flattens them down into 2D planes so you can texture on them.


What are seams? If UV unwrapping is just like flattening down a wrapping paper and texturing a design on it then seams are similar to scissors where you cut your 3D shape into 2D meshes and flattens them down so you can texture on them. To create a seam you need to select an edge and click "CTRL + E" then hit "mark seam"


How to check for Stretching and Distortion: 

To see if your uv unwrap is stretched, you need to apply a UV grid Texture to your model. Here is how to set one up in blender:

1. Go to the shading tab: Click "shading" at the top bar of your screen.


2. Create a Material: Click the "New" button in the shader editor. You will see two default nodes: Principled BSDF and Material output. 


3. Add an Image texture node: Press "SHIFT + A", search for "Image Texture" and place it down. Connect its "Color" output to the "Base color" of the Principled BSDF.


4. Generate the Grid: Click "New" inside the Image Texture node. In the pop-up window: Leave the resolution at default (1024 x 1024). Change the Generated Type from Blank to either "Color Grid" or "UV Grid". Click OK.




5. Check Your Model: Switch back to the layout workspace and set your viewport display to Material Preview (Top-right corner).


How to read the grid. Good unwrap: 

The squares or crosshairs across your mesh looks perfectly square, uniform in size and undistorted. Stretched Unwrap: The grid looks stretched into rectangles, wraped, or smudged. Whatever distortion you see in the grid is exactly how your final texture will look if the grid stretches, your paint stretches with it. 


Alright, now that we've covered the basics, let's get into how to actually UV unwrap. Here are a few key rules to follow when doing this.


If you have a complicated mesh, a good way to mark seams is to go to "Edit mode" and make sure nothing is selected. Look at the top of your viewport and click "Select" (it's located next to Vertex/Edge/Face select buttons). Click "Sharp Edges" this selects all the sharp edges on your model. Press "CTRL +E" and hit "Mark Seam" 



A warning: This isn't always an accurate result. You'll notice some selected edges that are scattered around randomly, and some edge loops have gaps where edges weren't selected. This is where manual cleaning comes in. Deselect any edges that seem to be in the middle of nowhere by holding "Shift + Left click" and manually select any missing edges in the loops the same way (Shift + Left click) until your seams are clean and continuous.


Hide seams in hidden areas:

Of course, the "Select > Sharp Edges" method won't work for every model. So here's the second rule: always place seams in hidden areas like the bottom of a shoe or the underside of a limb. This way the seams won't be visible in the final result.


UV Unwrapping a character body: 

When unwrapping a body, one thing to always look for is the seams of real-life clothing. Follow those seams and mark them in Blender. For example, the seam running along the sides of a shirt is a great reference point, treat your character's clothing seams as a blueprint for where your UV seams should go





UV Unwrapping the head:

Unwrapping the head is pretty simple. First, mark a seam around the base of the neck (a full loop). Mark a vertical seam going from the top of the head/hairline down the back of the head, until it connects with the neck loop.


But we're not done yet, the head typically has eyesockets and a mouth bag so the character can blink and talk.


Eyesockets:

Select a loop just inside the rim of the eyesocket (just behind the eyelashes) and mark it as a seam. If your eyesockets are deep, add one more seam running from that inner rim to the back end of the eyesocket, and you're done with the eyelids.


Mouth:

Add one seam behind the lips then move to the mouthbag, mark two seams, one on each side of the mouthbag, then add one more seam at the very end of the mouth bag, the filled cap at the end, and that's it.




Ears: 

UV unwrapping low-poly ears is pretty simple (another post will cover detailed ears and how to UV unwrap them, but for the sake of simplicity, this one will focus on low-poly ears). To do it, you just need to separate the ears from the head by marking a seam around the ear, then unwrap it by pressing U > Unwrap Angle Based/Unwrap. Next, check your color/UV grid to see if there is any stretching on the UVs if there are any stretches, adding a relief cut, which is a simple one mark seam, can help remove them. 

(A relief cut should be added if the ear (or anything else) you unwrapped has stretching if it does marking one seam on the stretched area can help eliminate the stretching/distortion shown on the color/UV grid).


That covers the head, eyesockets, mouth, and ears. I know it sounds a bit confusing at first, but think of it as a set of rules you can always follow whenever you need to unwrap a head. (also analyze these images deeply so you can understand perfectly.)


UV unwrapping hair: 

Now that we're done with the head, let's talk about how to UV unwrap hair. Hair is a bit different from the rest of the model, since hair strands are usually made from thick planes or curves. Unwrapping them normally and trying to texture them can lead to distortion. To avoid that, you need to make your UV islands perfectly flat.





The flat UV rule:

Here's a useful rule of thumb: whenever you're working with cylinder, pipes, roads, and paths, belts and straps, and in our case, hair strands, flat UVs are the best approach. In other words, if you have a cylindrical or boxy mesh, making its UVs perfectly flat is the ideal solution for that situation. 



How to flatten your UVs

Select a face in the UV editor. Make sure UV Synce Selection is turned off, this prevents other vertices and edges from distorting while you work. Switch to edge select mode by pressing 2 on your keyboard. To straighten the edges, click the top edge, then press "S, Y, 0" to straighten it horizontally, and do the same for the bottom edge (S, Y, 0). For the vertical edges, (the left and right edges) press (S, X, 0) to straighten them as well. Once you have one perfectly straight quad, select it and press L anywhere on the UV island to select all linked faces, then press the button U > Follow Active Quads. After clicking this, all the quads that weren't straight will turn into a perfectly straight grid plane, this gives you clean undistorted textures. 






Apply your scale: 

Now that we're done with marking seams before we unwrap the model itself we need to make sure that our 3D model's scale is applied, to do that all you need to do is select your model in object mode and press "CTRL + A" after hitting that button a small pop up will appear and all you need to do is select "Scale" this applies the scale. Why should we apply the scale? If you unwrapped your model and then scaled your 3D model in your viewport then blender stores a non-uniform scale which causes your UVs to stretch and be distorted, that's why people apply scale before UV unwrapping.



UV Texel Density & Packing Efficiency


After applying the scale, you can safely enter "Edit Mode", press "A" to select the entire mesh, then press "U" to open the Unwrap menu and choose "Angle Based Unwrap," or "Unwrap," everything will look messy at first, and that's normal because aligning and packing is where the real work happens. 





Packing Islands:


First, you need to pack your islands. Packing islands is basically a tool that arranges your UV islands to fit within the UV grid box. To do that open the UV editor, look at the top menu bar and click the UV tab. From the dropdown menu, select Pack Islands. A small settings window will pop up, change the "Margin" to 0.02 (the margin defines how much space there is between islands, since UV islands can't overlap unless you intentionally want them to share the same texture). Then hit "Pack Islands." What this does is rotate and scale your UV islands so they fit neatly inside the UV grid box.






Understanding Texel Density:


Texel density is the texture resolution relative to the size of the 3D model. In simple terms, it's the UV island being scaled to match the size of what you see in the 3D viewport, so the texture appears at a consistent resolution across the whole model. 


Average island scale: 

Average Island Scale is a tool that rescales your UV islands so their size in the UV editor matches their actual size in the 3D viewport. To use it, go to your UV editor, and press "A" to select everything, then hover your mouse on the top bar of the UV editor and click "UV" this will open a menu and all you need to do is click "Average Island Scale." Blender now looks at how big each part of your mesh is in 3D space and scales each island accordingly, so every part of your model gets the same texture resolution. Unlike Pack Islands, this tool only rescales; it doesn't move or rearrange your islands, so it's best used before packing. 




Note: You absolutely do not need to follow the average island scale. If you're making a 3D model for a game engine, your UVs should take up almost all of the space in the UV grid box, leaving a small amount of empty space is completely fine. So if the hand is slightly bigger than the arm in UV space because you need to reduce the empty space in the grid box, that's completely acceptable.


Optimizing the UV space:


An important detail when texturing a character for a game engine, you can't leave parts of the grid box empty, because every empty space represents wasted texture memory (VRAM) and reduces visual quality. So scale your islands as large as possible to fill the entire UV grid box (while still keeping space between the islands, of course. Not all space should be taken just try your best). 



Symmetry and Overlapping UVs: 


If you have two boots, for example, and both use the exact same texture (like solid black), you can stack their UV islands on top of each other. 

Why do this? When working on a detailed character, fitting all of its UV islands into the 0-1 UV grid would be almost impossible, there are simply too many islands. If two parts of the mesh share the same texture, the best solution is to overlap their UV islands and save space. Both boots will sample the same pixels, so they look identical, but they only take up space in the grid once. 



And that's it for UV unwrapping! If anything was confusing or you didn't understand a specific part of the post, please leave a comment. And if there's a specific tutorial you'd like to see next, let me know in the comments as well.

Comments

Popular Posts