Mixing textures in Photoshop and Softimage|XSI

One of the most important things when creating realistic images is the surfaces and textures. In this tutorial I will try to explain how to build surfaces in layers and how to mix different textures with eachother. I will explain how to do this in Photoshop and Softimage|XSI but the technique is the same in all 2D and 3D applications.

You probably have a small library of textures on your computer, what you might yet not know is that these textures can be combined in an almost infinite number of ways. I will show you two different methods of mixing textures. In this tutorial I will use two textures that I don't own the copyright to. The first texture (concrete) was downloaded from www.animax.it. Animax has a great library of textures and they can be downloaded for free. The second one (dirt/grime) was taken from the Surface Toolkit made by dvGarage. I really recommend that everyone working with texturing should buy this toolkit. It's a great resource when it comes to surfacing.


Mixing with different blending modes
Have you ever tried to combine two or more textures by simply putting one of the textures on top of the other and lowering the opacity of the top layer? If you tried this you've might have noticed that the result just becomes a mess after adding more layers. You lose detail and you can sometimes clearly see that the image contains several layers. I put together a small example of how this could look.

What I did here was to load the two textures in Photoshop, copy the "dirt" texture on top of the other texture and lower it's opacity to 40%. As you can see the result has more white and the two textures doesn't blend together in a natural way. You can also see that it loses some of the detail. The problem gets even worse if you add more layers.

The solution to this problem is very simple. All you have to do is change the blending mode of the dirt texture. In Photoshop you can do this with the little dropdown menu in the layer window. In this example I will use the blending mode "multiply", but when you do this on your own it's a very good idea to experiment with different blending modes. The result will look something like this:

As you can see the result doesn't have that unnatural whiteness to it and the two textures blend together in a much more natural way. Using this method you can combine your textures into new ones without loss of detail.

Different blending modes aren't just good for surface textures. Another great way of using them is for lighting effects. Let's say you have a lensflare on a black background that you want to add on top of your image. Even if you are using alphamasks a black or gray border will show up around the flare. In Fig 3 I'm using "normal" blending mode and in Fig 4 I'm using "screen" blending mode.


As you can see the "screen" blending mode leaves the background as it is on all areas where the "screened" layer is black and where the "screened" layer is white the final result will also be white. This is exactly what we want since the only thing we want to show up is the white flare.


Mixing with alpha masks
Mixing two or more textures together can also be done using alpha masks. An alpha masks is just a grayscale "image" used to control the transparency of a layer. In photoshop you can create an alpha mask on a layer by simply clicking on the "Add layer mask" button. This button can be found in the bottom of the layer window. Where the alpha mask is black the layer will be totally transparent, and where it's white the layer will be totally opaque. Different shades of gray will cause different levels of transparency for the layer. Getting an image into the layer mask can be a bit tricky. First of all you will have to copy the image you want to use as alphachannel into a new channel. To access the channels click
Window->Channels. Now create a new channel by clicking "Create new channel" this can be found in the bottom of the Channels window. Press Ctrl+v to paste the image into the channel. What makes channels special is the ability to load a selection from them. If you hold Ctrl and click with the left mouse button in the channel it will make a selection around everything that's NOT black. Pixels that are white will be completely selected and pixels that are gray will be partially selected. With this selection loaded go back to the Layers window and click on your alpha mask. Press alt+backspace to fill it with your foreground color or ctrl+backspace to fill it with the background color. You can also invert the selection by pressing Ctrl+Shift+i. Inverting the image can be done by pressing Ctrl+i but make sure you don't have a selection loaded when you do this or only the image in the selection will be inverted.


Building textures with layers in Softimage|XSI
Although it's very flexible to mix textures in a 2D package such as Photoshop you sometimes want to do this directly in your 3D package. In this section I will explain how to do this in Softimage|XSI. I assume that you already added one base texture/material to the object.

1. Select the object you wish to texture and click Render->Modify - Shader.

2. In the window that pops up click with your right mouse button on the little icon next to the sliders for the objects color and select Blend with->Image.

3. Press the "New" button and select the texture you wish to blend with the underlying texture/material.

4. Close the window and open up the rendertree. Double click the "diffuse_blend" node to open up it's property window.

5. In the window that pops up you'll see some parameters that controls the layer. The little icons on the right side means that you can map this parameter to a texture. Earlier I mentioned mixing by alpha masks and to do this in Softimage|XSI all you need to do is to map the image you want to use as transparency to the "Weight". Of course you can also use a simple color to control the transparency.

To demonstrate this I created a simple sphere, added the previously used concrete texture as base layer and added the dirt/grime texture to the first layer and set the mode to "Hue Offset (Overlay)".

As I see it using different blending modes is one of the most important things when creating graphics. If you aren't already working this way I really think you should take some time and learn it as there is a lot more to it than what I have written in this tutorial. Once you learned to work like this I think it's something you will use in almost all your graphic work. I really hope you learned something from this tutorial and if you have any questions please contact me at andreasbystrom@telia.com Comments on this tutorial are also welcome.

-Andreas Byström