

Derived maps
Making bump and specular maps for photo based textures.
Introduction
In the "old days" game artists didn't really care about bump, displacement or specular maps. Those belong to the realm of off-line rendering, along with prodcedural maps and HDRI. Then they started to sneak into games: multipass texturing made fake spherical reflection mapping possible, so in order to achieve certain effects, a specular map was needed. Then came normal mapping, shaders... so now for every diffuse texture we need at least a specular and a normalmap.
There are several ways to make a texture but maybe the most common is using a photo. This article is about generating bump and specular maps using that photo.
(Note: I'm using PaintShopPro but I think the workflow is pretty similar in Photoshop and GIMP.)
Example
First of all I'd like to point out that we are going to make an acceptable approximation of the real surface properties, and not an exact copy. (If you need a very precise bumpmap, you may want to look at Ryan Clark's tutorial on the subject.)
Okay, let's get started by aquiring a proper base photo. This one has no gross shadows, and the surface topology is quite random. No artificial structures or deep holes, so it's easy target.
Let's split the image into CMYK and HLS channels. They contain different aspects of this image, and while they keep the characteristics of the the original surface, the connection is not that straightforward. (Unlike when one uses the grayscale diffuse map as a bump.)
Now see the results of the CMYK channel split.
Cyan: Looks okay, we can use it later.
Magenta: Too similar to the original, we don't need it.
Yellow: Looks okay.
Black: Almost totally white, thus useless.
The HSL split had the following results:
Hue: It's cool. You can see white pixels all over the place, but we are going to fix that.
Saturation: Useful.
Lightness: It's just the base texture in grayscale so skip it.
Now we have 4 textures to work with: Cyan, Yellow, Hue and Saturation.
Let's fix the Hue first. The reason we have those ugly white pixels, is that the software maps the color wheel (which ends and starts with the same color) to a linear gradient from black to white. The quickest way to fix that is using the "Adjust Curves" command, and setting up a bell shaped curve. Sometimes (like now) it produces artifacts in areas (at the white island on the right), so let's use the "Despeckle" command a few times.
Finally fire a "Histogram Stretch" so the brighness values cover the whole 0-255 range. (This is applies to all grayscale images.)
Cleaning up the Saturation is pretty much the same deal: use "Despeckle" to get rid of the white noise, then stretch the histogram. Bumpmaps are very sensitive for high frequency noise so additional filtering may be necessary later.
We have prepared the building blocks, now comes the tricky part: mixing them together. Eventually I settled down with the layer setup showed on the left. (The "-inv" postfix means that a layer was inverted.)
In the Bump group I like to use the difference blendingmode, as it often provides visually interesting heightmaps. All the layers had more or less noise filtering. Bumpmaps could look bad when they contain high frequency - high contrast data. To remove that I used the "Edge preserving smooth" operation on the Hue and Saturation layers, with parameters of 4 and 10 respectively. On Cyan I used the "Digital Camera Noise Removal" with the correction blend maxed out. That resulted a very smooth, oil painted look, which gives us nice low frequency bump data. The Brightness/Contrast adjustment layer is for fine tuning the grayscale data.
The specular map's relation to noise is quite different. High frequency details can be used to show that a material has a more complex structure. The erode/dilate operations, combined with the "Edge preseving smooth" also makes interesting results.
Okay, here are what we got (Diffuse, Specular, Bump):
And this is how they look like in Modo (Diffuse only, Specular added, Bump added):
These textures are only one possible solution to the problem. Each texture is unique, tastes also differ, so keep mixing stuff until you are happy with the result.