In this comprehensive beginner Blender UV mapping tutorial, you will learn how to do basic UV unwrapping and texturing in Blender. You don’t need to know anything about UV or mapping to follow this tutorial. Btw, UV has nothing to do with sun rays.
The Theory Stuff
Before we get to Blender UV mapping and what it is, we need to know a bit about texturing. In the previous post, we learnt how to create Cycles shaders. Creating plain default shaders for your 3D models sure isn’t fun. You would have played around with different colors for your diffuse shaders, glossy shaders, or whatever to make it look more interesting. Apart from just changing colors, you can use textures. In the Node Editor, if you press Shift+A -> Textures, you will be presented with a few different texture types. These should be really obvious what they do. For example, if you choose Brick Texture, then you will get a brick like texture on your 3D models. If you select Noise Texture then you will get this colorful cloudy type of texture (Ok, that probably wasn’t as obvious, lol). These textures are called Procedural Textures (except the Image Texture). In other words, these textures will look good and consistent from any angle (as long as you set it up right). Procedural Textures are basically computer-generated textures.
However, sometimes you just don’t want that procedural look. Adding image textures instead of procedural textures tend to make your 3D models look a lot more appealing and just well, better. If you’re aiming for photorealism in your renders, you would certainly need to use real-world image textures a lot in your 3D models. The below image shows a procedural brick texture (left) and a real-world image texture of a brick (right) applied to a mesh. Clearly, the real-world image texture will look better on your 3D models than the procedural one.
But how do you define where the image texture maps to your 3D models. What I mean is, say you’re working on this really bad and buff 3D dude. And you want to add a tattoo on his arm. Firstly, procedural textures won’t cut it. A computer cannot generate a tattoo. Actually, it might if you use some complex algorithm but what I mean is, you probably want to design the tattoo yourself using Photoshop or GIMP or something. Secondly, it will be difficult to tell the computer to put the tattoo specifically on the arm and nowhere else. Procedural textures tend to distribute the texture all over the model.
So if you want to define (or paint) your 3D models, you need to use image textures. But how would you map the image of the tattoo to the buff dude’s arm? It’s not like Blender’s thinking “Oh yep, this is a tattoo image, so let’s stick it on this dude’s arm and hope my master approves”. You would need to do this mapping by yourself. This process is called UV unwrapping in Blender. The idea is that the vertices, faces and edges (coordinates) will be arranged in a 2D mapping grid. When you place your own image on top of the 2D grid, the coordinates in the grid containing the image will copy over the image to the corresponding coordinates on the 3D model. That was a bit difficult to explain. Here is a simpler explanation. Think of it like your 3D object wearing a full body suit. That suit is then squashed and arranged in a way that you can paint on it like a canvas. Sometimes you would cut pieces of the suit that are a bit difficult to paint on and put it on another vacant part of the canvas.
Blender UV Mapping Types
There are various types of Blender UV mapping options available. To see them, select your 3D model, tab into Edit Mode, make sure all vertices are selected and press U. The ones you would most likely be using throughout your Blender life is Unwrapping, Smart UV Project and Project From View.
Project From View – Perhaps the easiest form of UV unwrapping for beginners. Based on whatever view you are currently in the 3D viewport (front, side, or on an angle), the selected vertices will be “snapshot” onto the map. In other words, where you stand when you see the body suit, you take a picture, lay the photo down and paint on top of it. This method is perfect for tables and buildings and other cube-like objects.
Smart UV Project – The computer chooses the most optimum mapping based on the selected vertices.
Unwrap – Great for precise and correct UV mapping. This is what is mainly used in industry and as an artist you are mainly in control of the texturing. You mainly see this method being used for character texturing. This works by first letting you, the artist, define seams. Then those seams are “cut” and arranged on the “canvas” in a way that is ready to paint.
Learn by Example!
Enough of the boring theory stuff. Let’s learn by example. Blender UV mapping is a lot simpler to actually do than to explain.
(1) Open up Blender and select your default cube.
(2) Drag out a new window and change the type to UV/Image Editor. Also, drag out another window and change type to Node Editor. (Remember: To drag out a new window, left-click the corner of the window where you see the 3 diagonal lines and drag out)
(3) In the 3D viewport, tab into Edit Mode and select all vertices. Pressing A will select/de-select all vertices.
(4) Now press U to Unwrap and select ‘Unwrap’ as the option. (Menu version: Mesh -> UV Unwrap -> Unwrap).
(5) Observe the UV/Image Editor and see your 2D map. You should see a large square. Actually this is all the faces of the cube superimposed on top of one another. You can test this by selecting some of the vertices and moving them around. It unwraps this way because Blender doesn’t really know how to layout the UV map and makes an attempt at it anyway.
(6) Now change to the Edge Select mode.
(7) So now we’ll add seams. This is like telling Blender to cut the mesh using scissors so it will be easy to “unfold” and layout in the UV map. So let’s do that! Select all vertices by pressing A (if not done already), then press Ctrl+E. This opens open a menu containing a bunch of stuff you can do with the edges. Another way is to go Mesh -> Edges. Then press Mark Seam. You will see all the edges of your cube turn red. This now means every edge in your cube has seams marked and Blender will cut every edge.
(8) Unwrap again and see the result. It seems it has unwrapped nicely but it really hasn’t. If you select any vertice on the map and move it around, you’ll notice the faces are again disjointed but only arranged nicer this time. You can also confirm by hovering over a square and pressing L or alternatively, selecting a vertice and pressing Ctrl+L (Menu version: Select -> Select Linked).
(9) Although it is nice, we generally don’t want so many separate islands of squares on our UV map. Imagine having to texture a complex 3D model like a character. We don’t want a bunch of disjointed faces that are arranged anywhere. We want them connected nicely since it would be nicer to texture. So let’s strategically place seams so that it unwraps nicely. To do this, select the bottom face of the cube only and then Ctrl+E -> Clear Seam. This will remove the seams you created on this face.
(10) On the top face of the cube, select any one edge. Then Ctrl+E -> Clear Seam.
(11) Now do U -> Unwrap again. You should see a cube nicely unfolded and ready to have textures on them. The placement of the seams was really just trial and error. You need to have a good eye for selecting seams as it would improve your skills as a texturer (if that’s a word). Complex 3D models require good placement of seams, like characters for example.
It is now time to texture and see how our UV map affects our 3D model. If you don’t know anything about Blender Shaders, see this tutorial!
(12) To add an image texture, add a new material (Press “Use Nodes” if a material is already there) and then in the Node Editor, add an Image Texture by doing Shift+A -> Texture -> Image Texture and connect it to the Diffuse Shader. Below is what you should have.
(13) Load an image in the Image Texture node and then go back to the UV/Image Editor and open up the image you loaded in. You don’t have to open up the directory again to find your image as it should already be loaded in when you opened in the Image Texture node. Just click the image file icon with the up/down arrow (next to the UVs menu option) and select your image.
(14) In the 3D viewport, change the viewport type to Material or Texture.
(15) Select all vertices in the UV/Image editor by pressing A and then move/rotate/scale them anywhere (by pressing G, R and S respectively).
(16) Observe the change in the 3D viewport. You can see that the image texture is also being overlayed on your 3D model. This is how you control the exact position. This is how you put that tattoo on that bad dude’s arm.
I hope I have demystified the process of Blender UV mapping for you! It really isn’t all that hard. The main challenge is selecting the best places to put those seams and transforming the map around the image till it looks good on the 3D model. Luckily there are tutorials out there on the Internet to help you do that and I suggest you follow them. Try also playing around with the other types of UV mapping like Project From View and see how that changes the look of your 3D models. Thank you for reading!