Go to Gallery           Register for MyTrainz | Login to MyTrainz

Trainz Dev Diary - Detail Maps (micro detail)

By Admin, November 22 2017

We've used detail maps for macro-detailing (see the tutorial on "Trainz Dev Diary - Detail Map Ground Textures") but in this tutorial we use it for micro-detailing to add, in this case, some extra roughness to the surface.


You can read all about how the m.pbrmetaldetail material works on the Trainz wiki, but in a nutshell it is defined by:

1. The Alpha channel of the Albedo texture defines whether the detail map is used at this location on the material. 0.0 (black) indicates that the detail map is not used, giving a result identical to m.pbrmetal. 1.0 (white) indicates that the detail map is used at full strength. Values between these extremes offer a partial-strength detail map.

2. The Detail Albedo texture is an RGB: Albedo modifier. This is combined into the fragment's primary albedo on a per-channel basis. At 0.0, and at full detail map strength, the channel is reduced to 0%. At 1.0, the channel is increased to 200%. At 0.5, the channel is left at 100%. The result is clamped into the 0.0 .. 1.0 range. A: Unused. Should be omitted.

This texture example has been set to 0.5 (128,128,128) so the overall albedo colour will not change.

3. The Detail Normal texture is an RGB: Surface normal. This functions in an identical manner to the primary normal map, and is simply an additional offset to the normal. A: Unused. Should be omitted.


In this traincar example we tile the detail by 80 times across the sections of the mesh that have this m.pbrmetaldetail applied to it. The comparison of no detail vs. detail can be seen in this next video.


For more information on future Trainz development be sure to keep up-to-date at http://trainzportal.com 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 Trainz wiki