Creating a Tileable Texture: From Photography to Photoshop

Taking your best shot:

When taking the picture, stand a good distance away from the subject to avoid barrel distortion, a common phenomena of shooting with a lens (as shown in the first illustration). If you use a zoom lens, then in most cases 50% zoom is adequate to straighten the shot edges. Usually 100% zoom will bow the edges middle-inward, and 0% zoom will bow the edges middle-outward. Experiment to find out what the best distance/zoom ratio is with your camera.

Stand with the camera as close to perfectly perpendicular as possible to the surface you are shooting, to minimize any perspective from the shot. Imagine that if the texture was a perfect mirror, you would be shooting a photo of your own camera lens as the subject, as dead center in the frame as possible.


Lighting conditions: I've found that metals shoot well under bright, overcast conditions. Because metals have high reflectivity, the sun causes a bright hotspot, which does not work well in tiling conditions. When the image tiles, the hotspot is a dead giveaway. The image below shows an example of specular highlight from metal on a bright sunny day – this won't tile well. Architectural ornamentation is also good to shoot under bright overcast, because the deep recesses of woodwork will show up in the shot, and will not be too dark in comparison to the rest of the texture.


Avoid shooting highly reflective materials, like chrome. The reflectivity in 3D should be created within the 3D environment and with shaders, not in the texture itself (reflection mapping or raytraced reflections should create the reflections i the texture). So you should never see yourself in a reflection of what you are shooting. If you must shoot a reflective material, be ready to remove yourself from the reflection within Photoshop (see the editing section below), and to make the edges repeat seamlessly.

Organic vs. Geometric: Patterns that tile in the real world will tile well in 3D. It's good to use a subject with even and natural weathering. For example, a stucco building with rusty windows will naturally weather with similar rust stains along the building façade, in each window instance. In this case, you could probably include three or four window sections within your texture, since none of the drip stains overpowers the other. In the example below, you'd need to soften the drip edge below the center window, since it currently is in much sharper contrast than the other two windows.


WYSIWYG (What You See Is What You Get): Take time in setting up the shot and observe how the material reflects the light. Make sure shadows aren't too dark, and that there is not too much erratic weathering contrast within the frame. Often a picture will look sharp, but when you later view it on the computer in its full resolution you'll find the edges are actually blurry. To avoid this, after you've taken the photo check its quality with the image zoom feature of your camera.

Now that you know how to take a good photograph, I'll demonstrate how to seamlessly tile a texture within Photoshop and test the tileability within 3D Studio MAX. These methods will eliminate camera perspective and clean out unwanted effects, such as stains, trash, weathering and wires.

 
 


Photoshop – tools to know:
Crop
Select all/None
Distort
Rulers and Guides
Rectangular marqui
Clone tool (with feathered edges)
Paint Brush/Air Brush
Gradient tool
Eraser tool
Eyedropper tool
Offset

To begin, open your original image in Photoshop. If you use another image editing program, simply use the equivalent commands to follow along. To DISTORT the image into perfect rectangularity, first decide which portion of the photograph will make the best tile.

Then, open up rulers (CTRL-R) and drag the guides down from the ruler onto strategic corners of your texture. You should end up with guides on the outer edges of the "cream of the crop".

 

Then EDIT>TRANSFORM>DISTORT the corners of the image until all the lines are completely 90 degrees, and the area is perfectly rectangular. Always move the handles inwards, so as to not lose resolution. Hit the Enter button when you are happy with the rectangularity.


 

 
 


To crop to a tileable sample, click the CROP tool, then drag the crop edges to where the edge of the tile will connect to the corresponding edge on the opposite side. In this example, since we'll be cropping to the middle of the blue diamond, it's nice to copy a full diamond to the clipboard.

So select the cleanest diamond with the RECTANGULAR MARQUIS tool, then hit CTRL-C to copy. Don't paste quite yet, though.

 

It's a good idea to "SAVE AS" at this time. Never save over the original image, as you may screw up at some point and need to start over from the original image. Click FILE>SAVE AS, and select Photoshop File there. It's a nice uncompressed format that remembers the placement of your guides, layers, etc.

 

 

 


It's time to offset the image so you can clean up the seam (there usually is one). So click FILTER>OTHER>OFFSET, and select 500 Horizontal and 500 Vertical. If that's not enough, then you can CTRL-F (to repeat the offset) as many times as necessary to get a good workspace.

 

Paste the clean blue diamond (that you copied to the Clipboard a few steps ago) to the workspace. It should now be a layer of its own. Now you can hide the rulers/guides.

Use the ERASER tool (with airbrush settings) to erase the sharp edges of the new layer. This should start blending with the background. Once you're happy with the edge, MERGE the top layer with the background layer. Now you should be working with one layer.

 

 
 


Erasing the edges of the newly-pasted diamond layer.

 

 

Now it's time to clean the seam – this is the true art of the texture. On the toolbar click the CLONE STAMP TOOL (the icon with the ball as the handle). This works like a vacuum, which picks up texture from one area and sprays it out to another point in an airbrush-like fashion. This part takes some practice: to select the "vacuum from" area, hold down ALT, then click part of the texture, then release the ALT button. To spray that texture over the seam, simply click again on your "spray-to" area.

Sometimes it's better to just select a section of texture with the RECTANGULAR MARQUIS, copy, then paste onto a layer of its own. Move the patch over the seam and erase the edges with the eraser tool (as with the blue diamond). Then you MERGE that layer down to the bottom level, and CLONE stamp it again so that the new part doesn't look exactly like another part of the texture (similar is okay).

At this point it's a good idea to cross your eyes and see if any part of the texture "jumps out at you". If there is a part that jumps out now, it will surely be even more evident later. If there's a point of excessive contrast, it's a good idea to tone it down by CLONE-tooling a more subtle texture on top of it.

If an area is too light, then use the EYEDROPPER tool, with a 3x3- (or 5x5-) point sample to pick up one of the darker colors, then use the airbrush to paint that color (use MULTIPLY as a painting option, with 2% or 3% opacity) over the lighter color.

 

 

 

Once you're happy with how the edge is cleaned up, then SAVE. For this tutorial, I'm assuming you know the basics of how to apply bitmaps to a mesh within 3DS MAX (Of course, you can also use another application to test your tile – Ed.). Open 3DS MAX and in the LEFT viewport, draw a plane object (standard primitive) that is roughly square (150x150 units). Rotate the PERSPECTIVE viewport so that you are looking at the wall.

Open the MATERIAL EDITOR, then under the first selected material, click the "Maps" rollout. Then click the "None" slot in the "Diffuse Color" row, then double-click "Bitmap" option. Now find your Photoshop texture file. Amazingly, MAX will work with Photoshop files (it temporarily flattens the image for use within MAX). The only necessity is that you work with similarly "aged" versions of the software. So if the Photoshop file does not load, then you'll have to test materials saving as JPEG images instead.

Within the "Coordinates" Rollout of the material editor, make the "U" tiling 5.0, and the "V" tiling 5.0 as well. Click the checkered cube-looking icon, and then drag the material sample "swatch" onto the wall mesh. Now you can see it on the model in a tiled fashion. Render if you like, then return to Photoshop and fix anything that catches your eye too much in the tiling test.

 

Once you make the changes in Photoshop, then save again, then go back into 3DS MAX, then to the material editor, then click the "Reload" button. Repeat until satisfied.

When it tiles properly, you can hear the angelic choir singing "aaaaaaah" from above.