Web Update 19.10.2024

Power Lines

You are here:
Estimated reading time: 3 min

The container defines a track-lod-tree which describes a binary tree structure. When stitching the track geometry, Trainz breaks the spline up into smaller parts and then parses the track-lod-tree using the current view distance to determine which meshes to use.

category-class                          "ZX"
visible-on-minimap                      0
istrack                                 0
isroad                                  1
category-region                         "CZ"
category-era                            "1960s;1970s;1980s;1990s;2000s;2010s;2020s"
trainz-build                            4.6
kind                                    "track"

obsolete-table
{
}

The subdivisions tag causes the current track part to be subdivided into multiple parts, each of which is then passed through the track-lod-tree. Each part may take a separate path through the tree, however they all start at the current tree node and move downward (ie. the parsing does not re-start from the root of the tree.)

The lod-distance tag provides the distance (in meters) that defines whether the parsing will use the high detail path of the branch node (the current view distance is less than the lod-distance) or the low detail path (the current view distance is greater than the lod-distance). This distance is used as a guideline only, and may be affected by user performance settings.

mesh-table
{
  lod-0
  {
    mesh                                "pole.im"
    auto-create                         1
  }
}

Track parts are scaled to some extent based on the length of the Track Stretch being generated and the mesh-length tag. The lod-length tag provides a mechanism for forcing the high-detail path for short parts, even when the low-detail path would be appropriate given the distance. Specifically, if the generated geometry will be shorter than the lod-length setting, the high-detail path is chosen. This tag should be used with extreme caution, since it has the potential to ruin the LOD scheme and thus kill performance. This tag should only be used to select between a long (efficient) low detail mesh and multiple short (less efficient) low detail meshes, and never to force a change to an actual high detail mesh.

track
{
 mesh-length                           5
 
 track-lod-tree
 {
   lod-distance                        200
   
   high-detail
   {
       lod-season-index              1
			
	high-detail
	{
		mesh                        "track-lod0a"
	}
			
	low-detail 
	{
		mesh                        "track-lod0"
	}
   }
   
   low-detail
   {
       lod-season-index              1
			
	high-detail
	{
		mesh                        "track-lod1a"
	}
		
 	low-detail
	{
		mesh                        "track-lod1"
	}
   }
 }
}

Trainz determines a desired tessellation length based on factors which include the ground bumpiness and the bend angle of the spline.The lod-tessellation-length tag provides a mechanism for forcing the high-detail path for track parts with high tessellation requirements. The length (m) specified in this tag refers to the distance between tessellation points in the mesh, not to the whole length of the mesh. For example, a lod-tessellation-length of 6.0 indicates that the low-detail path is suitable for tessellation at around six meters, whereas the high-detail path is required for tessellation finer than six meters. The high detail path in this case should generally look identical to the low detail path, but with slightly increased tessellation along the Y-axis. This allows Trainz to increase tessellation without the cost of changing to an actual high detail mesh.

The lod-random-bias isn’t really a LOD scheme but instead allows for random selection between the high or low “detail” paths. At the default setting of 0.0, this has no effect. As the number is raised toward 1.0, the chance of forcing the high “detail” path is increased. At 1.0 or higher, the high detail path would always be chosen. While this tag can be used in tandem with other lod-* tags, the behavior is somewhat arbitrary so this isn’t recommended. A value of 0.5 gives a 50% variation between high and low “detail” paths.

track
{
  mesh-length                           300
  coordinate-transformation             "horizontal-shear"
  follows-ground-height-at-ends-of-mesh 1
  dont-scale-mesh-to-fit-length         1
  
  track-lod-tree
  {
    lod-distance                        300
    subdivisions                        1
    
    high-detail
    {
      mesh                              "lod-0"
    }
    
    low-detail
    {
      mesh                              "lod-0"
    }
  }
}

The lod-is-surveyor isn’t really a LOD scheme but instead allows for the display of different meshes in Surveyor (editing mode) versus Driver (gameplay mode.) When set to ‘1’, this tag causes the high “detail” path to be chosen when in editing mode.

The lod-season-index isn’t really a LOD scheme but instead allows for the display of seasonal meshes. When a specific season index (as per the “Season-selector” container) is specified, this tag causes the high “detail” path to be chosen when that season is current.

endcap-next
{
  mesh-length                           1
  coordinate-transformation             "horizontal-shear"
  follows-ground-height-at-ends-of-mesh 1
  
  track-lod-tree
  {
    lod-distance                        300
    subdivisions                        1
    
    high-detail
    {
      mesh                              "lod-0"
    }
    
    low-detail
    {
      mesh                              "lod-0"
    }
  }
}

The lod-piece-position isn’t really a LOD scheme but instead allows for the display of different meshes at the end of track. If present, valid options include “first”, “last”, and “first-or-last” which activate the high “detail” path when this mesh is (respectively) the first, last, or either the first or last mesh in the track (ie. the mesh is adjacent to an endcap position, regardless of whether an endcap mesh is present).

attached-splines
{
  0
  {
    lateral-offset                      0
    use-same-direction                  1
    spline-kuid                         <kuid:123456:123456>
    visual-only                         1
  }
}

kuid-table
{
  0                                     <kuid:123456:123456>
}
Tags:
Was this article helpful?
Dislike 0 0 of 0 found this article helpful.
Views: 8
Alpinetrainz
Logo
Shopping cart