jueves, 22 de julio de 2010

Textures for games

Find out how to tile images seamlessly in this tutorial. Discover how to create tiled textures using Photoshop.
These tiling techniques can also be applied to other graphics editors.
In this tile tutorial you’ll learn how to choose a suitable texture and how to make the texture seamless.
You’ll also learn how to reduce high contrast areas in the texture. This little-discussed technique will help make your tiled texture look even more natural.

Choose a suitable texture

Choosing a suitable texture is easy enough, as there are only a couple of things you need to keep in mind.
The texture ideally should be as big as possible. This is to help reduce the number of times it needs to be tiled on
a surface.
You should also look for textures with little to no hard lines or edges. While it is possible to tile these textures, it’s much harder to make them look natural.
The texture below is an example of what to avoid.
Before you begin on making the texture seamless, make sure that its width and height are divisible by two. Crop the texture to the correct height and width if needed. The reason for doing this will be explained later.

Make the texture seamless

The example texture we will be using for this tutorial is a nice, big rocky texture which contains no hard edges or lines.
Its size is 600 by 250.
Let’s see what happens when it is tiled on a surface:
The repeating texture along with its seams can be clearly seen.
Load the image into Adobe Photoshop or a similar graphics tool. From the menu, choose Filter/Other/Offset.
Set the horizontal offset to half of the image’s width, and set the vertical offset to half of the image’s height. As the height and width are divisible by two, the image should be easy to offset to and from its original position without any difficulty.
Select for the undefined areas to wrap around. Finish applying the offset to the image. You should now be able to see the edges of the image.
Select the clone tool from the toolbar. Use this tool to smooth over the edges using other parts of the image.
Once all the edges have been smoothed out, use the offset filter to move the image back to its previous position.
The image below shows the new example texture being applied. The seams have been removed; however the pattern repetition is still evident.

Reduce areas of high contrast in the texture

Areas of high contrast in textures should be reduced as much as possible, as they help create recognizable patterns and make the tiled surface look less realistic.
Use the clone tool to replace or disperse any areas of high contrast in the texture. In our example, we have replaced the lighter area with the darker parts of the texture.
When this texture is tiled on a surface the pattern is less recognizable.
I hope you enjoyed this tiling tutorial and can now tile images seamlessly for your games. As special thanks for reading the tutorial, you can use the finished texture from this tutorial in your own projects.