Realistic Walls in Blender


Introduction


In this tutorial I will detail one of my techniques to make realistic looking walls. I first used this technique in my Age of Steam image. The tutorial requires a basic knowledge of Blender, its material and texture system. I will therefore not describe every mouse click or button press needed. Shortcuts are written using the usual Blender conventions, ie: pressing the I key on the keyboard is written as: [Ikey] or simply [I], [RMB] = right mouse button, [LMB] = Left Mouse Button and [MMB] = Middle Mouse Button.

NOTE: Yafray has better texture filtering/rendering capabilities, so it is better to render this scene in Yafray (or another renderer) for photorealism, though not required.

STEP 1 - The Models


If you have your models ready, skip to Step 3!

First we need the models, in this case I have added a plane, and a cube. Start up Blender, select the deafalt cube with [RMB], scale it up to four times its original size with [Skey], [4], [enter]. In front view [numpad1], move it up 4 units ([G], [Z], [4], [enter]). Back in topview [numpad7] add a Mesh - Plane, and scale it up 10 times.

Now move the camera to a position to see the cube and the ground as well. I usually add an empty, and then make the camera look at that empty: select camera first, then select the empty, then press [CTRL+T] and choose "TrackTo Constraint". Move the camera a bit further, move the empty to look at the wall.

STEP 2 - Lighting


We will arrange the lighting before we start texturing for the sake of this tutorial. Lets say this will be an outside wall, in this case we will add two lights: a Sun light and a Hemi. Select the default light, move it to the right of the camera. Go to the Lamp buttons, and turn on Sun, and Ray Shadow, and make the lamp a light yellow. In front view, Rotate [R] the light up a bit, and then in top view, rotate it toward the 'building'.

Add one more lamp, move it to the top of the scene, make it a Hemi, decrease its energy to around 0.3-0.4, and make it a light blue. Finally, in the World buttons, change the default background to a very light blue. The scene in Blender:




Step 3 - Wall Textures


Now we get to the interesting part, the materials themselves. Add a new material to the cube building. We will need to add several textures in this technique. First, we will need two image wall textures. Either get them from the internet, or a texture compilation CD, or your own photographs. For this tutorial, you can use these two. Right click and choose "Save Link As...". These were downloaded from www.mayang.com, copyright is theirs. This is a rather old and worn wall, these were the textures used in the Age of Steam picture, though a higher resolution version.

Go to the Texture buttons, and insert these two images as textures in channels 3 and 5. The first two channels I always reserve for any additional textures that I need to add to the bottom of the 'texture stack' later. Channel 4 is needed in the next step. To do this: click on the third texture channel, click on Add New, and select Image in the Texture type rolldown menu. Click on the Load Image button and select the first image. Change the name of the texture to something meaningful, like "wall1.jpg". Do the same for the fifth channel. You should have something resembling this:



Step 4 - The Stencil Texture


Now on to Channel 4! The whole point of this technique is to disguise the repetitions of textures. To achieve this, I use a clouds type texture, set as a stencil, which will allow the second wall texture to show through at random spots, and leaving the first wall texture in the remaining random areas.

Click on the fourth channel, and add a new texture. In the Texture Type menu, select Clouds. Now click on the Colors tab. Enable the Colorband button. Now, you will see a colour gradient. Click on the leftmost, white and black vertical line (figure 4/a), and drag it to somewhere in the middle. Click on the black square, and in the colour selector popup, select white, or alternately move all the RGB sliders to 1.0 (figure 4/b). Now select the rightmost line, and move that near the first one, and also set it as white (figure 4/c). You should get a half-white, half-transparent clouds texture.




Step 5 - Material Settings


Go back to the material settings. In the Shaders panel, switch to Oren-Nayar, and Blinn. Move the Ref slider to 1.0. Move the Spec slider to somewhere around 0.5, and the hardness should be very low, around 10.



Step 6 - Mapping settings


On the far right, select the wall1.jpg texture channel. Go to Map Input, and set map type to Global, and the projection type to cube.

NOTE: I use global coordinates, because in this way I can apply the same material to any object in the scene, no matter how small or how big it is, and the wall texture will not be out of proportion. Using the original coordinates, I would need separate material settings for every object. Note though that global coordinates only work if the object itself is not moving!

An important setting here is the SizeX, SizeY and SizeZ parameters. You must determine how big the texture should be in the scene, so it doesn't look out of proportion. Since we're using Global coordinates, these parameters determine how many times the wall texture repeats itself in one blender unit of 3D space. Let's say the wall image itself is a photo of a wall segment about 2 meters in height. If 1 blender unit = lets say 50 cm in your scene, you need a SizeX=SizeY=SizeZ=0.25. Change these settings for both of the wall textures.

A trick here is to make the SizeX,Y,Z parameters a bit different, this means that the tile seams will be at different places on your model, and will trick the eye into not seeing the repetitions. For example, the SizeXYZ settings for the sceond wall texture could be 0.3.

In the Map To tab of both wall texture channels, turn on the Nor button, this is to have bump-mapping. You will need to fine tune the Nor slider later to match your scene.


Now onto the cloud texture settings: in the Texture tab, select the fourth channel, our white and transparent cloud texture. In the Map Input panel, set Global coordinates. The SizeX,Y,Z parameters should be about 1/3rd-1/4th of the wall texture's settings, let's say 0.1 in this case. In the Map To panel, Turn off Col, and turn on Stencil. This will cause every texture channel after it to only show up where the cloud texture is transparent.



Step 7 - Render - Fine Tune - Repeat


Now we're ready for a render! Render with either Blender or Yafray, go to the Render settings, and under the big RENDER button, select which one you want to use. See the image below for a comparison of the two, with the same settings. Yafray clearly gives a sharper, clearer picture, though you need to increase the light intensity a bit to match the Blender version.



So sticking with Yafray, I turn the Sun lamp more toward the front face of the 'building', but decrease the hemi lamp. Here's a better version:



Now for even more realism, we can turn on Ambient Occlusion for the internal renderer. Or full GI for Yafray.


Blender - Ambient Occlusion

Go to the World Settings, turn on Ambient Occlusion, and turn on the Both button. Set the samples button as high as your rendering time permits. Render!



Yafray - GI

Select Yafray as renderer, go to the GI panel, select Full, as type. Quality: high.

  • NOTE: GI adds light to the scene, a lot, so you should decrease the sun lamp's intensity to about 0.6, and turn off the hemi lamp entirely.
  • HINT: The GI lighting decreases the high-contrast (light vs. shadow) shading of the bump maps, so the Nor slider should be increased to about 1.0 for the same bump effect to come across.



WE'RE DONE!

Well, almost. The materials are done, but I also suggest that the model itself have some wear-and-tear modeled into it, like little cracks, and beveled, uneven corners, these might be the topic a future tutorial...

Download the finished Blend file HERE (104kb).

TIPS


  • The second wall texture we used had a very striking, large, easily recognizable pattern. On a large wall, even with this method, you will probably notice such patterns repeating. In this case, it can be advisable to change the stencil texture, so that less of the second texture shows through. Grab the right and then the left 'marker' in the gradient editor of the Texture buttons, and drag them to the right.
  • Use as high resolution image textures as possible! I usually don't use anything below 1024*768, and 3 - 4 megapixel images aren't rare either. Otherwise the texture will become blurred in close-ups, or high-res renders.