This article is part of the Blender Guide series:
- Blender 3D Basics: The Getting Started Guide
- Blender 3D Materials and Textures Basics
- Blender 3D Lighting and Rendering Basics
- Blender 3D Advanced Modelling
- Blender 3D Animation Basics
- Mastering 3D Rendering in Blender
- Mastering 3D Lighting in Blender
- Master HDR Environment Lighting in Blender 3D
- Mastering Blender 3D Textures with UV Mapping
- Mastering Depth of Focus in Blender 3D for Realism
- Building a Custom Ring in Blender for 3D Printing
- Mastering Blender 3D Digital Cinematography
- Blender 3D Building Virtual Video Screens
- Mastering Blender 3D for Lathed Objects
- Building Complex Camera Rigs in Blender 3D
Texture mapping is the art of sticking a graphic to the outside of a 3D shape to provide colour and texture. This is how you make your 3D graphics look real in Blender 3D.
There are basic texture mapping controls, but quite soon you realise in Blender that for all but the most basic objects, the way to go is what is known as UV mapping. In this article we explain how to do UV mapping in Blender 3D to make your objects look realistic and fully wrapped in colourful textures.
It’s a wrap
Once you have a 3D shape, you want to add a texture to it. On a basic level this is the diffuse map or the colour of the object. You can just project a bitmap graphic onto the shape, stamping it onto the shape in the X, Y or Z axis, or surrounding it like a cylinder, but that only really works for really basic shapes.
Real world objects don’t have just one colour – they might be aged or rusty or sun bleached. To make more realistic looking objects, you have to take the colours and tones and damage of your object and make them into a texture that you can wrap around the object so the textures look good from all angles. This is especially important if you are using Blender for visual effects and need to duplicate a real world object.
Basic UV mapping
Let’s take a basic bottle shape. It’s not going to be glass but sort of a matte pottery colour. It won’t win any awards, but the techniques will be nice and easy to follow, and you can start applying them to your own models right away.
As usual, set up “Cycles Render” mode by using the drop-down at the top of the screen. We always use “Cycles Render,” as the “Blender Render” is sort of basic. Cycles is much more complex and real looking.
In making a UV map, you don’t have to, but it’s advisable to make “seams” where the image is going to wrap around the object. You have to select edges and declare those as seams, so the shape unwraps predictably.
To do this on our demo bottle object, we first have to turn off that lovely subsurface modifier on the surface which it makes it look so curved. Click the little eye button on the subsurface modifier panel on the Material Properties, and the effect will not be displayed in the viewport.
Once the button has been clicked, the subsurface is no longer visible, and you can start to select edges for seams.
Press the TAB key to enter Edit mode. Select edge mode.
Now begin to select the edges of the bottle with “Alt + Right Click,” as this will select the whole edge as far as it goes to the top and bottom of the object. Select the corner edges, the edges of the square on top and the bottom. Hold the “Shift” key as you press “Alt + Right Click” to select multiple edges.
With all the correct seams selected, press “Control + E,” and choose “Mark Seam” from the popup menu.
The edges will turn orange indicating they are marked as seams.
It’s helpful at this point if you have a dual window open, so go to the bottom left-hand corner of the view window, hover by the little corner grooves, and wait till the cursor becomes a cross. Then drag the new window out so you have two windows on screen at the same time.
Then select the left window as a UV Editor window.
Now go into Face Mode by pressing the face mode button.
Select all the faces by pressing A. Now press U and select “Unwrap.” You now have a perfect, well nearly perfect, UV map for your image. This is now tied to the object; any image you map to this object will follow the map.
Now before you go any further, click the “Keep UV and Edit mode selection in sync” button at the bottom of the UV Editor window.
Now any selections you make on the object will show in the UV mesh. Use this to establish which face is the front of the bottle.
Now you need to export the UV map to some kind of image editor. You do this by selecting the “UVs -> Export UV Layout” menu item. A file chooser will pop up, and you can name and save the file.
You now have a basis from which to draw your image map for the UV surface in your favourite paint program.
Drawing the Image
Take the image into your favourite image editor, and colour the UV map in the way you would like to see it on the bottle. Pay particular attention to the part of the map that is the front of the bottle.
Position a label there and size it to be the right shape for the front of the bottle.
When you are happy with your image, save it as a JPG or PNG and go back to Blender.
Putting it all together
Once back in Blender, select your object and give it a new texture. Choose “Image Texture” from the pop up menu, and load the image map you drew in your image program. The UV map coordinates are saved with the object file, and any image applied to the object takes the map from the UV.
Add a bit of environmental lighting, turn your subsurfaces back on and render your result.
Okay, it’s not an award-winning shot, but it does what we set out to do: make a UV map that follows the contours of the shape and positions the label of a bottle on the front of the bottle object perfectly.
Of course, you could cheat, as many CG artists working in visual effects do, photograph a bottle from all angles and make an image map to fit from the photos. Many of the effects you see fleeting glimpses of in movies are done exactly this way. CG models of miniature starships are sometimes textured by photographing the model from all sides and just wrapping the images around the shape like a vinyl wrap on a car. We will be covering this use of UV, too, in a future article on visual effects.
There is so much you can do with UV mapping, the scope of it all can’t be covered in this basic tutorial, but we’ll come back to it in a forthcoming article.
Good luck, and have fun with UV mapping. If you have any questions, please feel free to ask them in the comments below.