Skip to Main Content

Tutorials + Resources

Shading and Texturing

Shading and Texturing

Charlie Pollock | Last Updated: Summer 2024

This tutorial will cover adding shaders to objects and mapping textures to the geometry.

Tutorial Contents

What is a Shader?

When you look at the chair model we made in the previous tutorial, it doesn't look like an actual object at all. Part of this is due to the lack of shading on the object. Shading is the way computers simulate lighting on 3D objects. The way we apply shading in Blender is through Materials - essentially, settings that describe how the object interacts with light. Materials can get very complicated very fast, but we will stick to a simple overview for now. 

Left: Chair with no shading. Right: Chair with simple shading.

Adding a Material

To add a material to an object, we're going to interact with another of the windows onscreen - the Properties Panel. This is located on the bottom right of the screen, and it controls essentially every setting available for objects in Blender. In this panel is located the Material Properties tab, which you can select by clicking on the checkered circle tab. 

In the material properties tab, there is already a starter material added to the object. However, we can't see what it looks like right now. To see the material, we need to switch into rendered view. To access this, go to the upper right corner of the 3D viewport and you will see the viewport shading options. Select the rightmost circle to switch into the rendered view. To switch back into solid view, the view we did all our modeling in, select the circle second from the left. You can also press Z while your cursor is in the 3D viewport to bring up a menu with all the view options.

If you're wondering why we don't just spend all our time in the rendered view, it's because calculating shading for objects can be hard on computers, and if you have a complicated scene it can run very slowly and be hard to work in. So, the solid view is generally used for adjusting models and layouts.

When you switch into rendered view, if you can't see your object, you might need to move your light source.

Did you delete your light before modeling, like I advised in the previous tutorials? If so, your rendered view probably looks a little dark. Not to worry, we can add a new light to the scene very easily. In the 3D viewport, we're going to add a light using the add menu, just like how we would add a new object. However, instead of choosing from the Mesh tab, we're going to go down to the Light tab. Select the Point Light - these are the kind of light that starts off as the default in the scene, and they emit light in all directions like a lightbulb. Try moving the light around a bit to see how the lighting reacts. 

You'll notice that the light is very dim. When you add a new light, it shines at a power of 10 Watts - if that doesn't mean anything to you, don't worry- with lights in Blender, all you need to worry about with the power is that more power means a brighter light. To change the settings for the light, go to the lightbulb tab in the properties panel. In there, you can change the power of the light by typing in a higher value. 1000 is a good starter for lighting up a scene.

Now that the light is sorted, we can start messing with the material. Select the chair again and navigate to the material tab. There will be a box at the top of the material settings labeled Base Color. If you click on that, you can change the color of the chair. To set it to brown, move the color into the orange section and make it darker with the slider.

Texturing

The material color is a good first step for making the object, but to make it look like a real thing we need to do something more. Real life objects don't just have solid, consistent colors. Textural detail like wood grain breaks up solid objects and gives them more visual noise. Take a look at the difference between this chair before and after a wood texture is applied.

So, how do we apply a wood texture to this chair? The first step is finding a texture, which can be done pretty easily by just searching online. If you want properly licensed textures, Wikimedia Commons is a good bet for finding public domain images. I got the plywood texture I used in the example above from here

Back in Blender now, to apply a texture to the chair we need to look over at the material settings. The Base Color selector has a yellow circle next to the color box. Clicking on that will bring up a menu with a lot of options. Find the option that says "Image Texture" and click it. The box will give you an option to open a file. Click on that button, labeled "Open," and locate the image on your computer. 

Now that the texture is loaded in, you will notice that it looks pretty stretched out on the chair. This is because of the UV Mapping of the object. UV Mapping is the term for how textures are placed onto the geometry of an object. The best way to understand it is to see it at work, so we're going to switch workspaces for the first time here. The UV Editing workspace is found by selecting the tab at the top of the screen.

In the UV Editing workspace, you'll see a window next to the 3D viewport. This is the UV Editor window, and you should see a bunch of faces arranged in there - these are the UVs. The way the faces are placed over the underlying image there is how the image is mapped onto the object in the 3D viewport. Try moving around the faces in the UV Editor, and the texture will slide around accordingly. (To move things in the UV Editor, make sure your mouse is in the UV Editor window and then either press G or use the tool from the toolbar, as we have done in the past.) You can also rotate and scale the UVs.

If you're wondering why they're called UVs, it's because U and V are considered to be a coordinate system (like X and Y) mapped to the object's geometry. Don't worry about that, though, it doesn't affect our use of them at all.

Simply transforming the UVs as they are isn't actually fixing the texturing on the chair. The back of the chair is still stretched out, so there must be something we can do about it. The answer is to "unwrap" the faces. Blender has a built in feature to do this, accessed through the UV menu at the top of the 3D viewport or by pressing the U key. Go to this menu, and select "Smart UV Project." This will automatically decide how to split up the faces for texturing, and it does a pretty good job. This can be done manually as well, but we're not going to get to that now.

In the UV Editor, one other thing you will notice is that the faces that show up there are the faces you have selected on the object. So, you can select specific faces you want to adjust and then move just those around. In the 3D Viewport, select the faces that make up the chair back. We're going to scale these a bit to make the chair back less stretched out. 

I rotated the faces and scaled them on the Y axis to even out the texture. In the UV Editor, all the normal transformation tools work as usual, just be aware that the X and Y axes are the horizontal and vertical axes, respectively. 

If there are other faces you want to fix, you can select and edit those in the same way as what we just did. It's very possible that the way your UV map is laid out is different from mine, so this is going to vary a lot from person to person. Just fix up anything you aren't happy with, and the texturing is done!