Transcripts
1. Introduction: Hey guys, in this class, we'll learn how to bake textures from
materials in Blender. What is it all about? To make things clear? Let's use a real example. Here's a model of a UFO that I created in
Blender. Very basic. By the way, I ought to have a class on how to
create such a model. So feel free to watch it. I added some materials to it. Here we can see it in the
tulip preview shading. It looks pretty decent. I think. This is the top part. This is the bottom part. Now let's export it to GL
Tf and input eight to, let's say panda 3D, which is a game engine. By the way, I'm going to create another class soon
on how to export models from Blender in a gtf format and input
them to spend a 3D. Anyway, as you can
see in Pandas 3D, all the colors are gone. This is because
in panda 3D or in other software where
you want to use the model, you need textures. So is there a way to create a texture using the
materials that we have? Fortunately, the race. And this is where you're
going to do in this class. If you want to create
a texture from immaterial in blender,
you have to beg it. Let's demonstrate it on
the model of the UFO. Open the blend file in Blender, and let's get down to work. But before we start, here's some info for you.
2. Mark Seams: Now there are two
materials in our project. So we'll have to
take care of both. But first things first, let's start by creating a nap and UV
unwrapping our model. But in order to do the ladder will have
to mark some sings. And our model, which we're
going to do in this lesson, seems other places
where our model will be cut before we flatten
it on a surface, which we call UV unwrapping. But first, let's
create a UV map. Select the UFO model, and go to the Object Data tab, which is over here. Under UV maps. Click on the plus sign button to create a new user
map, rename it bake. Also make sure the
newly created using map is the one that is selected. Now, this is a simple model. We'll add just a couple
of seams to add. The first scene will be added on the perimeter of the spaceship. Go to Edit Mode. By hitting Tab edge select mode, front view, hit one
on your numpad. Zoom in. Now, let's select the edge loop. In the middle on the perimeter. Just hold down Alt and
click on one of the edges. This will select the whole loop. Then go to the Azure menu
and select mark scheme. Now the color changes to red, which means a siem
has been added here. Now the same where the model
will be cut for texturing. We'll add another scene at
the base of the cockpit. So let's select the edge loop just above the blue material. So again, hold down Alt and
click on one of the edges. Now with ellipse selected, go to edge and select mark seam. Have two seems marked
the perimeter here. Now we can get rid of the
phases on the top part of the body that are
covered by the cockpit. We need to go into
see them anyway. Now to make it easier for us, let's temporarily
hide the cockpit in edit mode, deselect all. And then hover your
mouse cursor or the cockpit and hit L. This
will select just the cockpit. Now hit H to hide the cockpit. Now let's go to top view by hitting seven
on your noun pad. And let's go to face select mode and press C to activate
the circle select tool. And let's get rid
of all the phases here inside this marked seem, except the ones in
the outermost ring. Because otherwise there would be a narrow gap after
removing the phases. So we can now scroll our mouse wheel to make
the circle larger. Like this. And press the left mouse button to select the faces
that we want. Or we could alternatively select them one by
one or in groups. Now, to deactivate the
circle select tool, just right-click your mouse. Now, we can delete the phases by pressing
X and selecting faces. Now we have an opening
under the carpet. You will see it better
if you orbit your scene. Here is the opening. This way we have a
couple of vertices less to work with
later in the game. Now we're ready to
UV unwrap the model.
3. UV-Unwrap Your Model: Now in the previous part, we added some seems
to our model. Now ready to UV unwrap it. What does it actually mean? Uv unwrapping is the process of arranging the
phases of the model on a flat surface where they can be painted or where we can add
an image texture to them. This way we can decide what the texture should look
like on the model. So let's get to work. Hit alt plus H to
unhide the cockpit. Now, go to UV Editing
Workspace we use here. In the 3D view port. Here. Select all hit a and under UD, select the first option, unwrap. This is what we get. Well, this will do
for our purposes. It isn't perfect, but it
will do for our purposes. Now. You can see the islands, the particular islands on
the left in the UV editor. So each part here is
a separate island. You could also select the items in iron
slag mode like this. You don't have to do that. Now, let's de-select all.
4. Add the Image Texture and UV Map Nodes: Let's go to the shading
workspace, which is here. And under Materials
in the material tab, let's select the body of material in the shader editor
at an image texture node. To do that, just shift a. Then under Texture. Select image texture. This is the node will be
baking our texture too. Also add a UV map node. You can do it by hitting Shift and selecting it
from the input sub menu. So input UV map. Let's zoom in a bit. Now let's connect the UV map. So UV socket with the image
textures vectors suck it. Make sure these two nodes are not connected to
any other nodes. Then in the UV map node, select the bake you the
map we just created. Bake. Good. Next, we have to
create the image. We want to bake two. To do that, hit the new button
on the image texture node. Give the image a name like UF. Extra. Set both width and
height to 20482048. By 2048. Or you can use higher values. The higher resolution
the energy need, the larger values
you should use, preferably the powers of two. You can uncheck Alpha because we don't need transparency
information here. Finally, hit the Okay
button to create the image. Now, select the UV map
and image texture nodes. So hold down Shift and select
this one to zoom out a bit. Press Control plus
C to copy them. Then select the lights
material in the material tab, and paste the two nodes
in the shader editor. You can do it by simply
pressing Control plus v. Now select just the
image texture node in the light material
shader editor. Back in the bottom
material shader editor. Also select just the
image texture node.
5. Bake the Texture: In order to be able
to beg a texture, we have to use the cycles
for indoor engineering. Go to the render tab, which is over here. And select the Cycles
Render Engine. We have Evie, we need cycles. Then under bake, bake type to diffuse. This is the type of texture we need under contributions,
unchecked, direct and indirect,
so that the light does not contribute to how
to diffuse map Luke's. All we wanted to
contribute as the color. Also uncheck clear
image and or output. Finally, make sure
the UFO object is selected in the 3D
viewport or outliner. It is selected, we can
see hit the back button. It will take some time
to beg the texture. Here we can see the process. Now let me pause the
video and I'll be back. As soon as the
textures are baked. In the baking is done, you will see the image in
the image editor over here. Let's zoom out a bit to say it. Now click the button with
three horizontal lines and select under Image, Save As name the image. You have o texture PNG, and hit Save As image.
6. Test the Texture: In the previous part
of baked our texture, but that's it really
work. Let's check out. Now go to the layout
workspace, which is here. In order to keep
our original model intact and safe in case
anything goes wrong. Well, let's test the
texture on a duplicate. So select the UFO and hit
Shift D to duplicate. And move it aside so that
the two UFOs don't overlap. Here. Then go to the Material tab and select each of the materials
one-by-one and delayed them, which you can do by hitting
the minus button over here. Now the duplicate has no
materials attached to it. Then let's add a new material and set base color
to image texture. Now let's open the UFO texture
PNG image we just created. Open. You have a texture PNG. We don't see the texture
on our model has orbital. Now we can see the
texture on the model, but it doesn't look as expected. This is because there are two uv maps and
we only need one. Go to the Object tab. Select the UV map. Under a UV maps, there's one, not
the one we created, just the first one. Hit the minus button
to remove it. Now, the texture looks good. Now, if you zoom in, you is see that as opposed to
the original model, the texture is pixelated. This is because it's
a bitmap image. The size of the image
was set to 2048 by 2048, for our purposes,
this will do there. You can now delete
the original one. X to delete. We now have just this one. So let's put it in the
middle of the world. Let's select it. Shift
S, selection to cursor. Provided the cursor is in
the middle of the world. Good. We are now ready to
export the textured model to panda 3D or any
other software. We can use it for your game
simulation or other purposes.
7. Conclusion: Now we know how to
create a texture for materials
created in Blender. This is something you will
probably be doing pretty often if you're thinking about myelin game
assets in Blender. Alternatively, you can use ready-made textures
that you can create yourself or download from
one of many online services. Baking textures, feel free to experiment with the image size. We need different sizes
for different models. One more thing.
Before I wrap it up, we're interested in how
to export the model created in Blender
to gtf format, for example, in order to use it later in a game
engine like panda 3D. Stay tuned for my next class, exporting GIFs ETF models from Blender depend a through D, where I'm going to talk
about it in detail.