In the practical tutorials of Chapter 2, Having Fun with Modeling a Robot Drone Character, and Chapter 3, Let's Sculpt an Alien Plant!, you created a Robot Drone model and an Alien Plant model.
So far, these gray (untextured) models look great. Unfortunately, having these plain gray models on your virtual 3D movie set would not look that realistic, would it?
In order to make them look more real, first, we need to prepare the models so that they are able to receive textures and materials.
We will start by exploring some key concepts regarding textures and materials. Then, we will move on to learn about the concept of UV mapping.
After this, we will prepare our Alien Plants' shading and then go through the step-by-step process of UV mapping the model. We will do the same process for the Robot Drone model, but with some variations to our method since it is a mechanical model made up of multiple parts.
Once both Alien Plant and Robot Drone are UV mapped, we will briefly explore a free texture map baking software, called xNormal. Then, we will go through the entire process of baking texture maps with xNormal, for both our Alien Plant and Robot Drone models.
Finally, at the end of this chapter, both of your models will be UV mapped and have texture maps baked. They will be ready for the final texturing stages in Blender and Quixel Mixer.
At the end of these lessons, you will have a solid understanding of the whole texturing process: model preparation, UV mapping, and texture map baking.
For those who wish to skip this chapter's practical tutorials, the UV mapped Alien Plant model, AlienPlant_UV_Mapped.blend, and the UV mapped Robot Drone model, RobotDrone_UV_Mapped.blend, along with all of their baked texture maps are all available to download from the online repository at https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/tree/main/Chapter04.
In this chapter, we're going to cover the following main topics:
First, we will explore the core concepts of textures and materials.
You will need the following hardware and software to complete this chapter:
The Blender version used in this chapter is version 2.93.5. Even if your version of Blender is newer, the examples should still work without any problems.
The files related to this chapter are placed at https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/tree/main/Chapter04
In this section, we will explore the core concepts of textures and materials. First, let's start with the concept of textures.
In 3D computer graphics, we use something called a Texture (or a texture map) to describe an aspect of the mesh surface's appearance.
Usually, textures (or texture maps) are made from raster images (pixels in a grid format), or the textures can be procedurally generated (this is also known as Procedural Texturing).
Note
Procedural texturing is a 3D texturing method whereby textures and materials are generated by an algorithm inside 3D software (such as xNormal, Quixel Mixer, or Substance Painter). The algorithm uses information from your texture maps and/or 3D mesh, combined with settings that you have control over to create procedural textures. We will explain procedural texturing, in more detail, in Chapter 5, Texturing Your Models in Quixel Mixer.
Here is a brief description of the types of texture maps that we will use for our tutorials:
Now that you understand the different types of texture maps, let's explore what materials are.
Materials are made up of one or more texture maps. Materials use these texture maps to describe the various physical aspects of a surface's appearance.
Materials can also be procedurally generated in software such as Quixel Mixer or Substance Painter.
Here is an example of how texture maps could be used inside a hypothetical rock material:
In this section, you learned about the basic concept of textures, procedural texturing, and materials. This knowledge is an essential stepping stone for learning more about texturing as one of the main disciplines in 3D computer graphics.
In the next section, I will explain the basic concept of UV mapping and why it's needed.
UV maps represent a 3D model's surface as a 2D representation, as shown in Figure 4.1.
Imagine a geographical map of the Earth; the map is 2D, but we all know that it is a flattened representation of the surface of our planet and that the map wraps around the spherical (globe) shape. Similarly, a 2D UV map represents a 3D surface.
You can download an example of an Earth Globe model (Earth.blend) at https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/tree/main/Chapter04.
Open this Blender file and select the model named Earth. Then, click on the UV Editing Workspace tab to examine the UV map of this model.
This will give you a good understanding of the way that UV mapping works. See Figure 4.1 to view what this Earth model looks like in the 3D Viewport window and the UV Editor window:
Now that you understand the basic concept of UV mapping, let's do a practical tutorial to learn how to create a UV map.
Note
UV unwrapping describes the process of UV mapping. The term UV (or UVs) also refers to a model's UV map.
We will start our journey of learning about UV maps by UV unwrapping the Alien Plant model. Before we can start, we need to prepare the mesh's shading. In the next section, we will do just that.
Import the Alien Plant model from the directory that you used when you completed the Using Instant Meshes for Auto-Retopology section of Chapter 3, Let's Sculpt an Alien Plant!.
Note
Low-poly describes a low-resolution mesh (that is, low geometric detail). Similarly, the term high-poly describes a high-resolution mesh (that is, dense geometric detail).
Open the low-poly Alien Plant model in Blender and switch to Edit Mode with Edge Selection mode turned on. You will notice that parts of the mesh's edges are displayed in a turquoise color. This is because we've imported the model as a .obj file from Instant Meshes, and some edges are set to display as sharp. Fortunately, there is a very easy way to fix this:
So, you've just learned how to fix a shading issue caused by importing a model with edges that were set to display as sharp.
In the next section, I will show you how to place UV seams in your Alien Plant model.
Handy Tip
A quick way to select an edge loop (in Edge Selection mode) is to hold the Alt key while selecting an edge that is part of the edge loop. A quick way to select a range of edges (shortest path) in edge selection mode is to select the starting edge and then move your mouse pointer to the end of the range; then, hold Ctrl and left-click to complete the selection.
The first step of UV unwrapping the model is to place UV seams. These UV seams are a visual representation of the edges of the texture.
Take the analogy of the map of Earth. In order to flatten the Earth's shape (with no overlapping parts), it needs to be cut somewhere. These cuts are similar to UV seams.
So, now that you have a grasp of UV seams, let's create some UV seams on our Alien Plant model.
Let's start by setting UV seams on the biggest head of the Alien Plant model:
If you haven't done so already, download the completed UV mapped Alien Plant model, AlienPlant_UV_Mapped.blend, from the online repository at https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/tree/main/Chapter04.
Load this model into Blender to study the way that we have set the UV seams on the model. Switch to Edit Mode in the modeling workspace so that the UV seams become visible. Then, create your UV seams in the same way. The completed UV seams on the Alien Plant model can be seen in Figure 4.5:
So, you've just learned how to set UV seams on a model. In the next section, we will learn how to do UV unwrapping.
Now, we will start on the UV unwrapping stage of the Alien Plant model. Perform the following steps:
Enabling Stretching and setting the Stretching type to Area (in the Show Overlays menu) helps you visualize any stretching of your UV map by using colors.
The Blue and Green colors mean the UVs are optimal (that is, not stretched). The Red and Yellow-colored areas mean there is stretching (or the UVs have too much texture space allocated).
The minimize stretch function works best on organic-shaped meshes. It is best not to use the minimize stretch function on mechanical-shaped meshes (such as your Robot Drone model). The reason for this is that the algorithm that Blender uses for minimizing (UV) stretching works better on organic-shaped meshes. On mechanical-shaped meshes, it can sometimes cause unwanted distortions in your UV map.
Move and rotate the separate UV parts that you can see in Figure 4.7 (these UV parts are called UV islands in UV mapping terminology) so that the UV islands can fit better into the square. If you want to scale them, make sure you scale all of the UV islands together and only use uniform scale; otherwise; your UVs won't have an even distribution of texture space.
The UV mapping stage of the Alien Plant model is now complete. You have just learned how to UV map a model in Blender.
In the next section, we will prepare the Alien Plant model for exporting by triangulating its mesh.
At this point, your model is mostly made up of four-sided faces (also known as Quads). However, to bake the textures (and for use in Unreal Engine), we need the model to be made up of triangles (that is, triangular faces; also known as Tris).
Select all the faces in the model and then press Ctrl + T to triangulate the mesh. Save the model with the triangular faces in Blender's (.blend) file format.
You just learned how to triangulate a mesh for use in texture baking and Unreal Engine.
In the next section, I will show you how to export the Alien Plant model from Blender in .fbx file format.
Now, let's take a look at the settings we will use to export the Alien Plant model from Blender in .fbx file format.
Important
You will use the same settings as any other model that you want to export from Blender in the .fbx file format.
Perform the following steps:
See Figure 4.8 for all of the preceding export settings:
You have just learned how to export models in .fbx file format.
We will use this version of the Alien Plant model that you've just exported in .fbx format as the low-poly version of your Alien Plant model for use in xNormal for texture baking purposes in the Baking texture maps section. Later, we will also use this model inside UE5.
In the next section, I will show you how to create the UV maps for the Robot Drone model.
Handy Tip
To hide and unhide items or mesh components, use the following shortcuts: press H to hide the selected item or components. Press Shift + H to hide unselected items or components, and press Alt + H to unhide all items or mesh components.
In this section, you will UV unwrap each part of your Robot Drone model individually. Then, you will combine the unwrapped UV maps into a single UV map later.
We will start the lesson by loading the Robot Drone model that you created in the practical tutorial of Chapter 2, Modeling a Robot Drone Character. Perform the following steps:
If you haven't done so already, download the completed UV mapped Robot Drone model, RobotDrone_UV_Mapped.fbx, from the online repository at https://github.com/PacktPublishing/Unreal-Engine-5-Character-Creation-Animation-and-Cinematics/tree/main/Chapter04.
Note
There should not be any significant amount of stretching in your UV map if you place your UV seams in the same way as I did on my Robot Drone model.
Your UV map is now complete! The Robot Drone model should have a single UV map laid out inside the square, and this UV map contains all the individual parts of the model, as shown in Figure 4.11:
Note
Your UV map will differ in layout from mine, but the UV islands will be similar in shape if you placed your UV seams in the same place as I did.
In this section, you learned how to do UV unwrapping for mechanical-shaped models. This will come in very useful for your own future projects.
Now that you've UV mapped both the Alien Plant and the Robot Drone models, you are ready to move on to the texture baking stage of this chapter, which we will discuss, in detail, next.
Texture baking is a process by which the xNormal software (I will cover xNormal in the Introduction to xNormal section) takes certain aspects from the surface of the high-poly model and then projects those aspects onto the surface of the low-poly model, to create new texture maps. These new texture maps can be used in procedural texturing software, such as Quixel Mixer.
Note
We will cover the use of Quixel Mixer in Chapter 5, Texturing Your Models inside Quixel Mixer.
The end result of the texture baking process is a texture map that holds information about various aspects of the high-poly model. For example, some of these aspects include the degree of sharpness of the edges of the model or information about fine geometric details on the high-poly model.
In xNormal, we can choose which aspects from the high-poly model we want to bake into a texture map. For our tutorial, we will bake three of these texture maps. The three texture maps that we will bake are listed as follows:
Important
In Quixel Mixer, the texture maps that we will bake in xNormal are referred to as base maps. Quixel Mixer uses these base maps to generate procedural textures and materials that we will use in Unreal Engine later on.
In this section, you learned about the concept of texture baking and why we need it for procedural texturing.
In the next section, I will introduce the software called xNormal, which we will use for texture baking later.
xNormal is a free, standalone 3D software that is very popular for baking texture maps.
The reason we're baking texture maps in xNormal is that the process of baking curvature maps in Blender is far too complex for the scope of this book, whereas xNormal is extremely quick and easy to use.
You now know what xNormal is used for. In the next section, we will learn how to prepare the Robot Drone model for use in xNormal.
Now, we need to export the Robot Drone model's high-poly and low-poly meshes so that we can bake the textures in xNormal.
There are two versions of the model to be baked: the low-poly mesh and the high-poly mesh.
Let's start by preparing the Robot Drone model's low-poly mesh first.
In the UV unwrapping the Robot Drone model section, you separated all of your model parts. In other words now, the model parts are not attached to other model parts anymore.
We will now start to prepare the Robot Drone model's Low-Poly mesh for xNormal:
Note
The reason we're moving the mesh parts a distance away from each other is to avoid unwanted texture baking artifacts, which are caused by parts of other nearby meshes that are projected onto your baked mesh. The easiest solution for avoiding these texture baking artifacts is to bake your mesh parts with some distance between them. In texture baking terminology, a mesh with parts that are moved away from each other is referred to as an exploded mesh. You won't have the same problem when texture baking a simple (one-piece) mesh (such as the Alien Plant model), but this method is needed when you want to do texture baking on more complex mechanical model parts.
The Robot Drone's low-poly mesh is now complete. Next, let's move on to prepare the high-poly mesh.
Now we will start to prepare the Robot Drone's high-poly mesh for xNormal:
Both the high-poly model and low-poly model export process are now complete. You just learned how to prepare a very complex mechanical model with many parts for texture baking in xNormal.
Now you understand the different workflows that should be used when UV mapping and exporting models to xNormal for organic-shaped models and mechanical-shaped models.
In the next section, you will learn how to use xNormal for texture baking.
In the previous section, you prepared and exported the Robot Drone model's high-poly and low-poly versions for texture baking.
In this section, we will start on the texture baking process of the Robot Drone model. Then, afterward, you will use the same method for baking the Alien Plant model.
Open xNormal. You will see a floating window with various menus:
We only need a few steps of preparation before we are ready to bake our texture maps. See Figure 4.14 for xNormal's UI:
That's it! Your texture maps are now all baked! In Figure 4.19, you can see the six texture maps that I have baked in xNormal for my Alien Plant model and Robot Drone model:
Note
The UV maps' layout for your Alien Plant model and your Robot Drone model will be different than mine. But, it doesn't matter if your UV layout is different than mine since the texture baking process will still work in the same way.
Now you are ready for the procedural texturing tutorial using Quixel Mixer in Chapter 5, Texturing Your Models inside Quixel Mixer.
ln this chapter, you learned about textures and materials. You understand how to UV map 3D models that are either organic-shaped or mechanical-shaped in form.
You also gained knowledge about how to fix shading issues and triangulate and separate mesh components. Finally, you have learned how to bake texture maps in xNormal.
Going forward from here, in Chapter 5, Texturing Your Models inside Quixel Mixer, our learning journey will take us to the procedural texturing exercises, where we will texture both the Alien Plant and Robot Drone models.
18.226.222.89