Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (2024)

Spread the love


In the previous part of the Panda3D series we added materials to our building model:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (1)

If you want it to look more realistic, you might want to add some textures.

We’ll be using five textures altogether: one for the walls in the middle part of the building, one for the walls in the two wings, one for the roof, one for the windows and one more for the door.

I’m going to use the texturehaven.com and textures.com sites where you can download lots of textures for free. You can grab the textures from Github, the link is in the video description. You can see them here:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (2)

Download the texture files and make sure they are in the same folder as the blend file because this way the textures can be easily loaded in Blender.

Table of Contents

Texturing the Walls of the Middle Part of the Building

Let’s start with the middle part of the building. Before we add a texture, we should UV unwrap the model. This means we should unfold the faces so that they can be spread on a flat surface. To do that, let’s go to the UV Editing workspace:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (3)

As you can see, we have a 3D Viewport editor on the right, which is in edit mode, and a UV editor on the left where we’re going to spread our model thin. By the way, when talking about textures we use the U and V for the coordinates, hence the name UV editor. This is how we differentiate them from the X and Y coordinates used for the model.

Learn how to make beautiful GUI apps

in Python using the Kivy framework.

Comprehensive, for Kivy beginners, easy to follow.

Get the book here (PDF) or on Amazon:

ebook / paperback (black and white) / paperback (full color)

Anyway, first, we have to select the middle part of the building. The simple way to do it is by selecting the wall material in the Material tab and hitting the Select button.

All faces belonging to the middle part of the building have the same material, so they will be selected:

And now it’s time to UV unwrap. There are many ways this can be done, but as our mesh has perpendicular faces just like a cube, we can use a special type of unwrapping. In the UV menu select Cube Projection:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (6)

Now you can see the projection in the UV editor:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (7)

And now let’s apply a texture image to the selected part of the building. To see what the image looks like, let’s switch to Material Preview shading (A). Then, in the Material tab, click on the little yellow circle next to the Base Color slot (B) and select Image Texture (C):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (8)

Now hit the Open button and select the red_brick_03_diff_1k.jpg image file from the list:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (9)

Now you can see the image on the walls, but the bricks are too big. In order to change it, we must scale up the projection. As you can see in the UV editor, the walls in the projection are very small as compared with the bricks. This is why they look so weird on the building walls.

Your Panda3D Magazine

Make Awesome Games and Other 3D Apps

with Panda3D and Blender using Python.

Cool stuff, easy to follow articles.

Get the magazine here (PDF).

So, hit A to select all in the UV editor (A) and scale it up (S 7). Now the bricks look much more realistic on the building (B):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (11)

Here’s what it looks like in object mode:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (12)

Save the file.

Texturing the Wings of the Building

Next, let’s texture the wings of the building. So, go to edit mode, deselect all and select just the wings of the building. You can select them by material in the Material Properties tab, so go to the Material Properties tab, select the wings material (A) and hit Select (B):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (13)

We have to UV unwrap the selected parts of the building using Cube Projection like before. So, with the wings selected, go to the UV menu (A) and select Cube Projection. Then click on the little yellow circle next to Base Color and select Image Texture. Click Open to select an image and select the sandstone_blocks_08_diff_1k.jpg image from the list (B). Then go to the UV editor on the left and click on the drop-down (C) to change the image. Select the same sandstone image you just opened. Then hit A to select all and scale: S 25:

This is what the wings should now look like in object mode:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (15)

Save the file.

Texturing the Roof

Next, let’s add a texture to the roof. But first let’s create a vertex group and a material for the roof. So, go to edit mode, deselect all and select the faces that make up the roof.

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (16)

Python Jumpstart Course

Learn the basics of Python, including OOP.

with lots of exercises, easy to follow

The course is available on Udemy.

Now go to the Material tab (A), click on the little plus sign button to create a new material slot (B). Then hit New. Rename the material ‘roof’ (C). Finally hit the Assign button (D) to assign the material to the selected faces:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (17)

The faces that make up the roof have already been UV unwrapped, so you don’t have to do anything about it. Set Base Color to Image Texture, open the TexturesCom_RooftilesBitumen0020_1_seamless_S.jpg image (A) and change the image in the UV editor to the same roof image. You can do it by selecting the image from the drop-down that appears near the top of the UV editor (B). Select all in UV editor and scale down (S 0.2):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (18)

Here you can see the roof in object mode:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (19)

Save the file.

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (20)

Blender Jumpstart Course

Learn the basics of 3D modeling in Blender.

step-by-step, easy to follow, visually rich

The course is available on Udemy and on Skillshare.

Texturing the Windows

Next, we’re going to texture the windows. Go to edit mode, deselect all and select all the windows by material. To do that, select the windows material (A) in the Material tab and hit Select (B):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (21)

Then we have to UV unwrap the selected faces, this time using the Smart UV Project option from the UV menu. So, with the windows selected, go to the UV menu (A) and select Smart UV Project and in the window that opens hit OK. Set Base Color to Image Texture and open the TexturesCom_WindowsHouseOld0341_M.jpg file (B). Open the same image in the UV editor (C):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (22)

This time we only need to use just a small portion of the image to texture the window. Let’s use the portion with the window on the right.

Now, we want all windows to have the same texture, so the optimal solution would be to move and scale them so that they are just above the portion of the image with the window. Doing this by hand would be tedious and inaccurate because there are so many windows. But as all the windows are the same size, we can do it in a simpler way.

First, with all the windows selected in the 3D Viewport editor, select Reset in the UV menu (A). This will map the UVs to the entire image, so they will be all at the same position and the same size (B). So, go ahead and reset the UVs:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (23)

Now, select all in the UV editor. Move and scale the islands (this is what we call the UVs that are now stacked on top of one another) so that they are exactly above the right window on the image. While doing this watch the 3D Viewport on the right to see how all the window are being textured simultaneously.

You should end up with something like this:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (24)

We’re done with the windows. Here’s what they look like in object mode:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (25)

Save the file.

Texturing the Door

Finally, let’s texture the door. This should be a piece of cake for you. Go to edit mode, deselect all and select the door by material (A).

The door is very simple, so you can just select the basic Unwrap option in the UV menu (B), which is the first one in the menu. After you unwrap the door, you will see it immediately in the UV editor (C):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (26)

Set Base Color to Image Texture and open the TexturesCom_DoorsWoodPanelled0170_S.jpg file (A). Open the same image in the UV editor (B):

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (27)

Select all in the UV editor, move and scale as necessary (A), watching the texture all the time in the 3D Viewport (B). The door image will have slightly different proportions, but don’t worry about that:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (28)

And here’s the door in object mode:

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (29)

Save the file.

So, now our building model is finished. We’re ready to export it to Panda3D. This is what we are going to do in the following parts.


Spread the love

Panda3D Part 12 – Texturing the Model in Blender - Prospero Coder (2024)
Top Articles
Latest Posts
Article information

Author: Fredrick Kertzmann

Last Updated:

Views: 6832

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Fredrick Kertzmann

Birthday: 2000-04-29

Address: Apt. 203 613 Huels Gateway, Ralphtown, LA 40204

Phone: +2135150832870

Job: Regional Design Producer

Hobby: Nordic skating, Lacemaking, Mountain biking, Rowing, Gardening, Water sports, role-playing games

Introduction: My name is Fredrick Kertzmann, I am a gleaming, encouraging, inexpensive, thankful, tender, quaint, precious person who loves writing and wants to share my knowledge and understanding with you.