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

    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.

    SNEAK PEEK VIDEO


    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 http://trainzportal.com or see all the articles and have your say forums

    Comments 6 Comments
    1. BuilderBob's Avatar
      BuilderBob -
      Is the height information a separate height map, or is it incorporated into the normal map as implied in the above comment? If it is incorporated in the normal map, can you indicate how this is done (is it the vector length)? This will help to ensure that inappropriate height information is not inadvertently included in normal maps currently being created.
    1. Dinorius_Redundicus's Avatar
      Dinorius_Redundicus -
      What does "0.5" on the height map scale mean? Is it something absolute like 0.5m or just some way of denoting an arbitrary maximum?

      And is the height map itself a separate image file or somehow made as a channel of the normal map? Me no understand.

      .
    1. Pencil42's Avatar
      Pencil42 -
      The height map should be a separate; additional texture. We're already using the alpha channels for the diffuse and normal maps for specular and environmental strength maps.
      It would be nice if this new material could be applied to meshes also - it would be useful for cliff / ground splines or rough rock walls, for example.
      While we're at it, it would also be nice to be able to use the water materials on meshes for river/ stream / lake splines / meshes that don't align to the grid.
    1. Dinorius_Redundicus's Avatar
      Dinorius_Redundicus -
      I thought N3V were saying PBR will apply to meshes too. Wasn't that why they featured a loco in the publicity shot?
    1. SailorDan's Avatar
      SailorDan -
      Quote Originally Posted by Pencil42 View Post
      The height map should be a separate; additional texture. We're already using the alpha channels for the diffuse and normal maps for specular and environmental strength maps.
      The comment is "...where the normal-map texture includes an additional "height" channel in addition to the usual XYZ normal information.". I that's not correct it should be changed.

      The alpha channel is already used, but the vector length is available for height information. If the vector length is going to be used they should say so now.
    1. n3vpolsen's Avatar
      n3vpolsen -
      More information will be released on the Trainz wiki about this but there is a little bit up there already. Your existing assets up to TANE SP2 should be fine the way they are.
      http://online.ts2009.com/mediaWiki/i..._Groundtexture
      http://online.ts2009.com/mediaWiki/i...Material_Types
      http://online.ts2009.com/mediaWiki/index.php/M.pbrmetal