Adding colors

Now that we have the proper UVs on our objects, let's dive into the fun part, that is, the texturing. It is the more artistic part of the process, so let's start by discovering the Texture Paint tool of Blender.

The Texture Paint tool is a mode that allows you to paint directly on a 3D object in the 3D Viewport while applying color to the texture. This requires having textures with a sufficiently high resolution. One of the interesting points is to paint on a 3D polygonal mesh with a low density.

To observe the paint of our textures in 2D, we need to split the 3D Viewport in two and switch the second type editor to UV/Image Editor.

To activate this, we first select an object, click on the Mode drop-down menu in the Header, and switch to the Texture Paint mode.

If you don't have any UVs, a message will warn you in the left panel (T) of the 3D Viewport. You can generate UVs automatically with the Add Simple UVs option, but it is much better to unwrap them yourself as we saw earlier.

In the Slots tab, there is an important parameter, that is, the Painting Mode. It gives a choice between two options. The Material option allows us to paint automatically linked textures to a material in Blender Internal. The Image option allows us to paint the texture without necessarily having a material linked to the object. For this first approach of the Texture Paint tool, we will be especially interested in the Material option.

If in Texture viewport Shading Mode (Z) your object displays a pink color and you see the message Missing Data in the left panel (T). Select Tools, to correct this; you will need to click on the Add Paint Slot option. Here, several texture types are available. This will automatically create a texture corresponding to a slot of the material with the required settings during the painting phase.

We can start testing a Diffuse Color map. Several options are proposed. They are the same as when we create a new texture. You can rename the texture and choose the height, the width, and the color with an alpha value. You can also choose whether you want an alpha layer (it is the opacity), the type of texture to generate, and finally, the 32-bit float option. Press OK to create this texture. A new material is then automatically created if there are none of them. You can visualize it in the Material editor on the right-hand side of the work space.

To modify this, you can change the name with a double left-click on the name.

It is possible to create several stacked textures one above the other like layers in the material. You must select the one that you want to paint in the Slots tab of the left panel. The bottom slot is the one that is first visible. You can also choose the Blend Type to mix pixels. There are the usual Blend Types (add, subtract, multiply, and so on.) that we can find in every decent image editing software. The Slots tab allows us to also change the UV layers, which can be very useful.

Now that you know the basics to generate and manage a texture for painting, we will look at the brushes.

As in the Sculpt Mode that we saw previously, we have multiple brushes in order to paint our texture. They all have some specific purpose that we will test on a simple sphere object in a new scene file. Be aware that the goal here is not to do something beautiful but to test our brushes.

The Stroke option allows us to completely modify the brushes' behavior. It is, therefore, important to focus on this for a little while.

First of all, there is the Stroke Method option that allows us to choose among several methods for applying the colors:

There is another key element that will determine the settings of your brush. It is the curve located just below the Stroke tab. It works exactly in the same manner as the Sculpt mode that we saw previously. Depending on whether you want a hard or thin brush to paint the details, remember to use and test several curve profiles. There are already several predefined shapes that can meet your needs.

We are now ready to apply what we've learned previously about the Texture Paint tool on our haunted house. Let's start!

For any image that uses colors, it is necessary to lay down a color palette. This means that we will need to find the colors that will make up our image. In our case, for the house, we have chosen the following color codes:

We have the ability to create a color palette by clicking on the + (plus) button near the color wheel. However, in order to have an idea of the whole color scheme, we will start by fulfilling the 3D mesh that we had unwrapped object with the colors. This is done as follows:

We redo these steps for all the objects. Since our objects' UVs are proportionally scaled, their size should be sufficient in order to place the maximum number of objects on the same diffuse map.

Be careful to not select the tiling layer for the UVs while filling your objects.

It's now time to take advantage of our tiled UVs by painting our own tiled textures by hand! In this section we are going to show you how to create the roof texture step by step, and as the process will be very similar for the wood plank, ground, brick wall, and rock texture, we will only give you some advice in order to get a nice result. So let's get started by setting up our painting environment.

Let's start our roof tile texture from the texture that we've created in the UV/Image Editor in the previous section.

  1. Before starting to paint our texture we will change our curve to be a little bit pointier. We can easily select a curve preset in the Curve subpanel.
  2. The first thing that we need to lay down is the tile pattern. In order to trace that we will use the same tint as the background color that we chose when creating the texture but darker. We then re-size our brush size (F) and start to paint a row of 'U' shapes for the first top tiles. We need to space them proportionally according to the size of our texture. For the next rows we will do the same thing with a little offset. The top-left part of the 'U' shape needs to touch the middle of the above ones. Note that if you are lost while having the repeat option activated, you can always help yourself with small helping markers that you can erase later (refer to 1 in the following screenshot).
  3. Now that we have the basic pattern drawn, we can start to add a little bit more detail with the shadows. For this we are going to select a darker color, but still in the blue shades. Because shadows will be faded, we are going to decrease our strength a little bit (Shift + F). Here, the shadows that we are going to paint are projected because of the tiles that are placed above. This will act like contact shadows (refer to 2 in the following screenshot).
  4. Now that we have our shadows we can start to add some scratches on the tip of each tile. You need to remember the fact that it needs to be as homogeneous as possible, so don't paint big scratches or it will break the tiling effect (refer to 2 in the following screenshot).
  5. The last thing that we are lacking here is some highlights. When painting highlights we use a white color and decrease our strength and size. We then slightly paint the highlights where we think we have hard edges. For instance we can emphasize the scratches (refer to 2 in the following screenshot).
  6. That's all, you've now completed your first hand-painted texture (refer to 3 in the following screenshot).
    Painting the roof-tile texture

    Steps for the roof tile texture creation

We aren't going to show you step by step how to do each tiled texture as it would require a lot of space and it would be a very repetitive task. Indeed when we are doing such a texture we first always create a texture with a flat color, and then lay down the pattern with a darker color. Once we are satisfied with the pattern and the way it tiles, we add the shadows, more details, and finally the highlights (the specularity).

As you can see on the wood texture, it is quite difficult to add the ribs and having a good tiling, so later we will need to take this problem into account on the objects that will receive the texture. But we can't add ribs on wood or it will look strange. For the ground we can add a little bit more detail, such as small rocks and crackles. The bricks are quite easy to do, but if you feel you can add more detail, you can easily paint moss between each brick.

We are now going to project our tiled textures on other textures that correspond to the UVs of our different objects.

One thing we haven't learnt until now is how we can produce texture with an alpha channel. Indeed this could be very useful in order to add some details on the previously baked texture (grunge or leaks, for instance) or even grass.

Usually, when doing grass, fur, or hair, we use the integrated particle hair system of Blender, but in our case we will show you a technique that can do the job as well and can save us render time. It will also accommodate very well with the style of our scene. This technique will simply consists of a plane mesh on which some grass strands will be projected; using the alpha we will be able to just render the strands. Note that this is a very common technique in the video game industry. So let's start our grass texture by first setting up our transparent texture!

  1. We will first go in the UV/Image Editor and create a new texture. In the color setting of the texture, we will change the alpha channel to 0 in order to have a full transparent image. We then leave the 1024 x 1024 resolution and validate our settings.
    The grass texture

    The grass texture settings

  2. We can now use a pointy curve and start to paint some strands starting from the bottom of the texture to the top with a de-saturated green. We really need to think about painting a dense grass mound.
  3. In order to add more realism to our grass texture, we can add some touch of yellow. We also need to add some white on the tip of each strand. It is quite important to use a reference when painting some textures; it helps to develop our sense of perspective and come with more believable results.
  4. Remember to save your texture on your hard drive or you will lose it (Image | Save as image)!
  5. We can now place our texture on a new plane (Shift + A). We do a quick UV on it by simply pressing U and selecting Unwrap in the Edit Mode.
  6. We will now create a new material that will use our texture. To do that, go to the Material icon in the Properties editor and press the plus icon. If you already have a default material, you can delete it with the minus icon.
  7. So our material can understand the alpha channel, we will have to activate the check box of the Transparency subpanel and select the Z-Transparency mode with its Alpha value set to 0.
  8. Now we will tell our material to use our grass texture. To do this we click on the texture icon of the Properties editor and click on the first available texture slot. Under the Image subpanel we click on the far left drop-down menu and select our grass texture. The last thing we need to do is to activate and set the Alpha slider under the Influence subpanel to 1.0.
  9. We can have a preview of our texture in the 3D Viewport by activating the GLSL mode in the right panel of the 3D View (N) under Shading. Note that you will need to be in the Texture Shading mode (located under the Viewport shading drop-down menu in the 3D View header) and you also need to have lights.
  10. We can now duplicate the plane object as an instance to have more grass. Note that you can also add a subdivision to the plane and in the last tool options you can change the Fractal slider in order to add a little bit of randomness. Remember that the render in the viewport is a preview, not the final render.
    The grass texture

    The final grass texture in the viewport (left) and in the UV/Image Editor (right)