Parallax maps

From FreeGameDevWiki

Jump to: navigation, search
Parallax mapped wall texture in Sauerbraten
Parallax mapped wall texture in Sauerbraten

Parallax mapping is a shader-based technique for depth simulation on lowpoly geometry. Ordinary height maps serve as a source of data.

A parallax map is a greyscale image, where pure black represents the lowest possible and white the highest possible elevation pixel-wise.

Using existing texture data

Example diffusemap
Example diffusemap

One way to create parallax maps is to edit the diffuse map, by desaturating, blurring, changing brightness and contrast, selections etc., until it more or less fits the needs of the artist. Although results often may look promising, this way won't work properly with every kind of texture. Sometimes, it's better to paint the parallax map by hand.

The tutorial

Side note: This tutorial is written for GIMP version 2.4

A parallax map is always greyscale, colors don't matter - So desaturate your texture first. Always do that! (Image:Stock-convert-grayscale-16.png Colors/Desaturate/Lightness).

The initial texture might have too much details which don't have anything to do with height and may be too noisy - So blur the texture with rate 2.0-6.0 (depending on texture - a higher rate can complicate the tiling process) (Filters/Gaussian Blur), Offset it by x/2, y/2 (Shift + Ctrl + O -> Offset by x/2, y/2), blur it again with the same values, Offset it again by x/2, y/2 and you've got a tillable, blurred version of your texture.

Change brightness and contrast (Image:Stock-tool-brightness-contrast-16.png Colors/Brightness-Contrast)

Resulting parallax map
Resulting parallax map

Since you can't ensure that all areas have the correct elevation, it would be good to edit specific areas independently. Use the Free (Image:Stock-tool-free-select-16.png Tools/Selection Tools/Free Select) and Fuzzy select tools (Image:Stock-tool-fuzzy-select-16.png Tools/Selection Tools/Fuzzy Select).

Using Threshold, Levels and Curves to modify/limit can also be very handy (Colors/Threshold, Colors/Levels or Colors/Curves)

Handpainting

A handpainted parallax map
A handpainted parallax map

It's better to paint the texture by hand, when the texture has simple, clear shapes and thus isn't very complex.

Personal tools