Normal map creation

From FSDeveloper Wiki
Jump to: navigation, search

One of the new features that can be used on our 3D models in FSX is the bump map. This article will describe how to create the normal map texture that you can use on your model.

Bump mapping is a technique that makes a surface look uneven. For example a brick wall consisting of only one polygon, could look like it has been made of individual stones. If you would model that all in 3D it would require a lot more polygons. What the normal map does is adjust the local normal based on the value stored in the normal map, so instead of having the same normal for the entire polygon, now each pixel can have a different normal. That results in the uneven look.


To follow the rest of this tutorial you need to make sure you have the following tools at hand:

Creating a grayscale height map

The diffuse map texture
The grayscale height map texture

The normal map plugin that we will be using to create the normal map, needs a grayscale height map as input. You can see this as a texture where the different shades of gray give information about the height of that pixel. It sort of gives a relief of your diffuse texture.

Simply turning your diffuse texture into grayscale does not give the best result. On the other hand creating the height map by hand is also a lot of work and requires quite some artistic skills. But fortunately there are some tricks to get your started.

One of the best ways to create a grayscale height map I found is to make use of the filters in your painting program that allow to make a photocopy or charcoal version of your texture. If you play around a bit with the settings of such a plugin, you will see that you can generate a quite convincing height map. For the final details you will probably have to edit the texture, but it should give you a good starting point.

Creating a normal map

The normal map texture

The next step is to use the normal map plugin for your painting program to turn the grayscale height map into a normal map. What this does is turn your grayscale relief into a format where the information is stored in the red, green, blue and alpha channels of the image, so that the graphics card can process the information quicker.

The normal map plugin has a lot of options and feel free to play around with them. The most powerful is probably the scale setting. In the FSX material section of the SDK you also find some examples of what different bump scales can do.

Once you are happy with the settings, generate the normal map. It could look like the example shown on the right, although I exaggerated the scale a bit in this case to make things more clear for the tutorial.

Saving in FSX format

The normal map texture in FSX format

Because of the way the shaders have been written for FSX you can not use the normal map you just created directly. You will have to do some modifications to it. Failing to do so will result in a unrealistic view of your model.

Here are the steps you need to take:

  1. Copy the content of the red channel to the alpha channel
  2. Make the red channel black
  3. Invert the green channel
  4. Make the blue channel white

The image on the right shows the resulting normal map for FSX.

After that save your normal map as DXT5 texture. Due to the different compressions in the DXT format, DXT5 is strongly preferred over DXT3 for your normal maps. You can do this with the ImageTool tool that comes with the SDK.

Assigning to your model

Material editor assign normal map

Now that you have your normal map texture file that you can use in FSX, we are almost done. The final step is to assign the normal map to your 3D model so that it will actually be used. For this you need to make sure you use a FlightSimX material on your object.

Using Gmax, all you have to do for this is assign the texture you just created to the Bump slot of your material. See the image to the right for an example. As you can see I prefer to use the PSD version of the texture in GMax.

Using FSDS, you need to install FSDSxTweak, and then assign the bump map (which must be a DDS file) using a material tweak (see this tutorial).

After this export your model to MDL as before. The next time you load your aircraft or scenery you should see that it has a bump map now.

The result

Model without normal map
Model with normal map

So what did we do all this extra effort for? The two images below show the difference between a model without and with a normal map applied. In this case the normal map scale has been put a bit higher than normally desired to make the effect stronger, but I hope you can see the benefit of using normal maps in some cases.