Trainz Dev Diary - Height Map Ground Textures (sneak peek)

By Admin, September 15 2017

While we're still hard at work on updating "Trainz A New Era", we're also busy creating the next generation of Trainz. We're not quite far enough down the track to commit to a time frame for release, but we thought it was time to start opening the doors slightly on some of the dramatic changes you can expect to see in the future Trainz product.

We've been working on adding height mapping to our shaders in the Trainz engine. This is effectively a distant relative of normal mapping, where the normal-map texture includes an additional "height" channel in addition to the usual XYZ normal information.

The height information is used to perform simple ray-tracing on the GPU, resulting in some ultra-realistic visuals. To be entirely honest, the technique does have its limitations - you can't simply add it to every asset and expect it to benefit everything equally - but used correctly it can add a lot to the scene.


Most content creators will be used to having a diffuse texture (or in the future Trainz product using PBR, it will be an albedo texture) and a normal texture.

In order to get "depth" to your ground textures you will need to generate a height map.

You can do this using the albedo or the normal texture in a number of software applications so don't worry if you don't want to make these manually yourself. You might need to make some tweaks based on how much depth you want your height map to actually have. On the right of that height map you can see a range from -0.5 to 0.5. Basically 0 is the ground level of the terrain currently in Trainz. You adjust the grayscale image to go in positive and negative directions (lighter or darker) in order to achive the height you are after.

It's also worth emphasising right now that this technique requires some serious GPU power. If you don't have a moderately high-end gaming GPU, you probably won't be using this.

For more information on future Trainz development be sure to keep up-to-date at or see all the articles and have your say forums

All content creators wanting to start to look into the technique will find some initial information on the wiki