Textures: what, why and how

I read once that an artist spends 1/3 of the time modeling, 1/3 in texturing and the last 1/3 in lighting...

So as I have previously explained some of the methods to model, I would now like to talk about textures.

The textures give the material aspect to the object. In my example below I have a simple sphere and I will put some textures on it. As you will see, results may vary in an amazing way, and even with a simple shape like a sphere I can get some cool results.

Well, now that you have seen textures can change the material aspect of an object, we will examine what textures are. Textures generally, could be from two different families: images, or procedural.

So we may have some formula like red_color=sin(U) and blue_color=cos(V). But why use images or procedural texture?

Well... depends of your need. Procedural textures are slower than image textures but will archive a better result. In 3D games it's quiet impossible to use procedural texture to describe every thing, but maybe it could be used to create some special things like fire or water. Procedural texture are also difficult to create and doesn't always look like a real thing.

The biggest advantage of procedural textures are the rendered quality. With an image texture you have a defined size. When you zoom at the object you will start to notice some strange results and it's not easy to apply images textures to complex object like organic things because the texture will be stretched over the object.

The following example demonstrates the difference from the procedural texture (on the left) and the same texture but applied as a image texture (on the right). I used a planar UV mapping for objects so the application of the texture was the same.

There are different components in a texture beside the fact of how to produce them (images, or procedural). The first is the color component which will change the color the object has. In the following example I will create (just with textures) a broken wall with some bricks underneath.

The second one is the bump map which adds some 3D aspect to your texture. This is extremely useful because it creates some sort of geometry without the need of complex object. The bump map is a gray scale image where the black is the lower part of the object and the white the highest part.

And now just for the fun I show you the result with those two components. OK the image is darker because I change also the luminosity of the object, but as you can notice there is some small shadows on it that will give you the impression of a 3D object.

Actually there is still a problem with images texture, you will need seamless textures if you want the possibility to repeat the pattern or very big ones if you want to have textures that are not repeating themselves.

With procedural textures you do not have this problem (in general). So I have transformed my texture with some tricks to be seamless, but you will notice it's not that good lining up vertically and I should work on it a bit more if I want to use it.

You may click on the picture above and below to see a page with that texture as the background. (Use the back button of your web browser to come back here)

But it's not finished here ! you may also have other properties on you texture like transparency, reflections and more you have more you will use :-)

All those "channels" may use a gray scale image of a procedural function to explain where a part is more transparent or has more reflections.

The dark part will be transparent for example and the white part will contain your colors and bump map. In the following example I use a checkerboard to produce different reflection of the object.

The example of the wall I used in this article was designed by myself with a procedural texture generation tool. It took me more or less 2 hours to achieve the result I desired.

You may find a screen shot of what my procedural texture looks like.

A texture can also be animated. To produce for example waves, flames or whatever you would like. This could result in some amazing things in animations.

A last word. In the 3D client we will use square textures and they must be a power of 2 (32x32, 64x64, 128x128, ...). The format actually used is BMP but may vary.