Procedural Textures vs. Bitmap Textures
Blender has basically two types of textures, which are procedural textures and bitmap textures. Each one has both positive and negative points. Which one is the best will depend on your project needs.
- Procedural: This kind of texture is generated by the software at rendering time, just like vector lines. This means that it won't depend on any type of image file. The best thing about this type of texture is that it is resolution independent, so we can set the texture to be rendered with high resolutions with minimum loss of quality. The negative point about this kind of texture is that it's harder to get realistic textures with it.
- Bitmap: To use this kind of texture, we will need an image file, such as a JPEG, PNG, or TGA file. The good thing about these textures is that we can achieve very realistic materials with it quickly. On the other hand, we must find the texture file before using it. And there is more. If you are creating a high resolution render, the texture file must be big.
Do you remember the way we organized materials? We can do exactly the same thing about textures. Besides setting names and storing the Blender files to import and use again later, collecting bitmap textures is another important point. Even if you don't start right away, it's important to know where to look for textures. So here is a small list of websites that provides free texture download.
To use a texture, we must apply a material to an object, and then use the texture with this material. We always use the texture inside a material. For instance, to make a plane that simulates a marble floor, we have to use a texture and set up how the surface will react to light and texture, which can give the surface a proper look of marble using any texture. To do that, we must use the texture panel, which is located right next to the materials button. We can use a keyboard shortcut to open this panel: just hit F6.
There is a way to add a texture in the material panel as well, with a menu called Texture.
The best way to get all the options is to add the texture on the texture panel. On this panel, we will be able to see a lot of buttons, which represent the texture channels. Each one of these channels can hold a texture. The final texture will be a mix of all the channels. If we have a texture at channel 1 and another texture at channel 2, these textures will be blended and represented in the material.
Before adding a new texture, we must select a channel by clicking over one of them. Usually the first channel is selected, but if you want to use another one, just click on the channel. When the channel is selected, just click the Add New button to add a new texture.
The texture controls are very similar to the material controls. We can set a name for the texture at the top, or erase it if we don't want it anymore. With the selector, we can choose a previously created texture too—just click and select.
Now comes the fun part. Having added a texture, we have to choose a texture type. To do that, we click on the texture type combo box.
There are a lot of textures, but most of them are procedural textures and we won't use them much. The only texture type that isn't procedural is the image type.
We can use textures like Clouds and Wood to create some effects and give surfaces a more complex look, or even create a grass texture with some dirt on it. But most times, the texture type that we will be using will be the Image type.
Each texture has its own set of parameters to determine how it will look in the object. If we add a Wood texture, it will show the configuration parameters at the right.
If we choose as texture type Clouds, the parameters showed at the right will be completely different.
With the image texture type it's not different, this kind of texture has its own type of setup. This is the control panel:
To show how to set up a texture, let's use an image file that represents a wood floor and a plane. We can apply the texture to this plane and set up how it's going to look, testing all the parameters.
The first thing to do is assign a material to the plane, and add a texture to this material. We choose as texture type the Image option. It will show the configuration options for this kind of texture.
To apply the image as a texture to the plane, just click on the Load button, situated on the Image menu. When we hit this button, we will be able to select the image file.
Locate the image file and the texture will be applied. If we want to have more control over how this texture is organized and placed on the plane, we need to learn how the controls work. Every time you make any changes to the setup of a texture, these changes will be shown in the preview window; use it a lot to make good changes.
Here is a list of what some of the buttons can do for the texture:
- UseAlpha: If the texture has an alpha channel, we have to press this button for Blender calculate the channel. An image has an alpha channel when some kind of transparency is stored in the image. For instance, a .png file with transparent background has an alpha channel. We can use this to create a texture with a logo, for a bottle, or to add an image of a tree or person to a plane.
- Rot90: With this option we can rotate the texture by 90 degrees.
- Repeat: Every texture must be distributed on the object surface, and repeating the texture in lines and columns is the default way to do that.
- Extended: If this button is pressed, the texture will be adjusted to fit all the object surface area.
- Clip: With this option, the texture will be cropped and we will be able to show only a part of it. To adjust which parts of the texture will be displayed, use the Min/Max X/Y options.
- Xrepeat / Yrepeat: This option determines how many times a texture is repeated, with the repeat option turned on.
- Normal Map: If the texture will be used to create Normal Maps, press this button. These are textures used to change the face normals of an object.
- Still: With this button selected, we can determine that the image used as texture is a still image. This option is marked by default.
- Movie: If you have to use a movie file as texture, press this button. This is very useful if we need to make something like a theatre projection screen or a tv screen.
- Sequence: We can use a sequence of images as texture too; just press this button. It works the same ways as with a movie file.
There are a few more parameters, like the Reload button. If your texture file suffers any kind of change, we must press this button for the changes get accepted by Blender. The X button can erase this texture; use it if you need to select another image file.
When we add a texture to any material, an external link is created with this file. This link can be absolute or relative. When we add a texture called "wood.png", which is located at the root of your main hard disk, like C:, a link to this texture will be created like this: "c:wood.png", so every time you open this file, the software will look for that file at that exact place. This is an absolute link, but we can use a relative link as well. For instance, when we add a texture located in the same folder as our scene, a relative link will be created.
Every time we use an absolute link and we have to move the ".blend" file to another computer, the texture file must go with it. To imbue the image file with the .blend, just press the icon of gift package.
To save all the textures used in a scene, just access the file menu and use the Pack Data option. It will make all the texture files embedded with the source blend file.
Every time we add a texture to any object, we must choose a mapping type to set up how the texture will be applied to the object. For instance, if we have a wall and apply a wood texture, it must be placed like wallpaper. But for cylindrical or spherical objects, or even walls, we have to set up in a way that makes the texture adaptable to the topology of the surface, to avoid effects such as a stretched texture.
To set this up, we use the mapping options, which are located on the Map Input menu.
On this menu, we can choose between four basic mapping types which are Cube, Sphere, Flat, and Tube. If you have a wall, choose the option that matches the topology type with the model. In this case, the best choice is the Cube.
Another important option here is the UV button, which allows us to use another very powerful type of texturing, based on UV Mapping.
This is a special and useful type of texture, that can change the normals of surfaces. If we have a floor and a texture of ceramic tiles, the surface can be represented with smaller details of that tiling, using this kind of a map. It's almost like modeling the tiles. But everything is created using just a normal map.
To use this kind of texture, we must turn on the Nor button on the Map To menu. When this button is turned on, we can set up the Nor slider to determine the intensity of the normal displacement.
It works based on the pixel color of the texture. With white pixels, the normals are not affected, and with black pixels, the normals are fully translated. If you want to optimize the normal mapping, using a special texture is much recommended. Some texture libraries even have this type of normal maps ready for use. They can be called bump maps too.
Here is an example of how we can use them. We take a stone texture and a tiled texture with a white background and black lines.
The stone texture is applied to the floor, and the tiled texture is used to create a tiling for the floor. The setup for that is really simple. Just apply the texture at a lower channel, and turn off the Col button for this channel. Turn on the Nor button, and this texture will affect only the normals and not the material color. Any image can be used as a normal map, but we will always get better results with a greyscale image prepared to be used as a normal map. Now, just set up the Nor intensity with the slider, and see the render.
Turn on positive and turn on negative
Some of the buttons on the Map To menu can be turned on with positive and negative values. For instance, the Nor option can be turned on with one click. If we click on it again, the Nor text will turn yellow. This means that the Nor is inverted with negative values. Some other buttons may present the same option.
For some models, just placing an image at a surface is not enough. We have to take more control over all textures, and even create a more personalized texture for a model. With UV Mapping, we can create a texture image that fits exactly with all the surfaces of a model, with the possibility to add details, such as dirt and small imperfections to the texture image. Some of the painting of a texture can be done in Blender.
This kind of editing has to be done outside Blender, with painting software such as Gimp or Photoshop. Once this editing is created, we have to just apply the new texture again to the model.
What do we have to do to create a texture like this? The process for using this kind of texture is simple, although the task can demand a bit of editing. We must mark the model with some cutting lines called seams.
Let's see how it works with a wall. The first step is to select the model and change the work mode to UV Image Editing.
Change the selection mode to edge, and select a few edges. Press the CTRL+E shortcut, and choose the Add Seam option. With this, we will mark the cutting for the model. What's the best edge to mark? Well here, we will have to use a bit of imagination.
To choose the best edges, we must imagine the best places to mark and unfold the model. When the seams are marked, open a new window, and change the window type to UV/Image Editing.
When this new window is opened, press the U button. It will call the unwrap function and create a flat layout with the unfolded model. Sometimes this operation requires a lot of testing and adjustment to produce a good result. But with the right seams, it will produce a nice and good flat image with all surfaces.
Now, we have to export this layout as an image. To do that, we use a very good script called "Save UV Face Layout...". Just access the UV menu in the UV/Image Editing window and choose Scripts | Save UV Face Layout....
It will call a small menu, with the options for this script.
To set up the layout, we must change the following parameters:
- Size: Here, we can set up the size of the image. Always use a big value to create high-resolution textures. Use 1024, 2048, or bigger.
- Wire: The layout will be saved with the wires from all faces. This option will determine the width of these wires.
- Object: With this button turned on, the object name will be used for the file name.
- All Faces: This button sets up the script to export all faces, and not just the selected ones.
- Edit: With this button turned on, an image editing software is opened right after the layout is exported.
After editing the layout, we can apply the layout as a texture. But we must turn on the UV button at the Map Input menu. It will make the material look for a UV Mapping image to be shown.
Now, all we have to do is press F12 to render the image, and the texture will be applied to the object.
The operation of creating a UV Mapping can be very annoying for some people, because we have to imagine the unfolded model to mark the seams. To help us in this task, there are a few Scripts to automatically create the seams and unfold the model. One of them is projected especially for architectural models.
The name of this script is ArchiMap UV Projection Unwrapper, and it's very easy to use. Just open a new window and choose a UV/Image Editor as the window type. Then, with the UV menu, choose the Scripts option and call the script.
The Angle Limit will determine how the faces will be unfolded. Bigger angles will generate layouts with grouped faces, and smaller angles will create layouts with more islands. The selected faces button makes the script unfold only the selected faces or all faces.
The Stretch to Boun button, makes the layout fit the UV layout. The Bleed Margin determines a limit for the UV layout to grow outside the limits of the window. And with Fill Quality, we can set up the overall quality of the filling for the faces, if the Fill Holes button is pressed.
See how it works for this model:
Selecting the model and calling the script will result in the following layout.
In this article, we have learned how to use textures to give our materials more realism. There are basically two types of textures, which are procedural and bitmap. For us, the bitmap textures will be the most useful, for the creation of scenes with more realism.
Besides that, we also learned how to:
- Choose and organize textures
- Apply and set up a bitmap texture
- Map a texture around a model
- Use normal maps
- Create UV Layouts to create more complex textures
If you have read this article you may be interested to view :
- Modeling, Shading, Texturing, Lighting, and Compositing a Soda Can in Blender 2.49: Part 1
- Modeling, Shading, Texturing, Lighting, and Compositing a Soda Can in Blender 2.49: Part 2
- Creating an Underwater Scene in Blender- Part 1
- Creating an Underwater Scene in Blender- Part 2
- Creating an Underwater Scene in Blender- Part 3
- Creating Convincing Images with Blender Internal Renderer-part1
- Creating Convincing Images with Blender Internal Renderer-part2
- Textures in Blender