In the "Export to Trainz: Basic files, DEM and ground textures" dialog, enable "custom colour textures" and set the path to "TransDEM128_mapping.txt" (to be found at C:\Program Files\Ziegler-Tools\TransDEM-Ground-Textures for a default installation).
Let me explain the fundamental principle of TransDEM handling Trainz ground textures again:
- The number of Trainz ground textures is limited to 256 for a classic 10 or 5m baseboard. Ground textures are assigned per ground vertex.
- Each ground texture is a Trainz asset and defined by KUID.
- TransDEM comes with two sets of ground textures, the default one with 20 textures, optimized for cartographic maps, and a second one with 128 textures for ortho-imagery. (Different versions of these sets exist for different versions of Trainz.)
- The default texture set has grid lines (10m), the ortho-image set does not.
- To get from raster images loaded in TransDEM to Trainz textures, a mapping is required.
- The mapping is based on RGB colours where one particular colour maps to one particular texture KUID.
- The colour to texture mapping is defined in the *mapping.txt file.
- When exporting, TransDEM first resamples the raster image loaded to the baseboard resolution of 720x720pixel or 1440x1440 pixel (10m/5m grid). This is done per baseboard.
- Then TransDEM reduces the number of colours of the resampled image to the number and values of colours in the *mapping.txt file.
- This colour reduction is called Colour Quantization and the algorithm used by TransDEM is called Octree.
- So, after quantization, the raster images processed for export will have exactly the colours defined in the *mapping.txt file.
- TransDEM then builds the texture lookup table for each baseboard, registers the texture KUIDs in there and assigns a texture index to each ground vertex, based on the quantized colour value of that point.