"texture-variants" container

From TrainzOnline
Revision as of 19:13, 15 September 2017 by Windwalkr (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The "Texture-variants" container of a KIND Groundtexture asset provides alternative material configurations for the texture to display as seasonal variants.

The "Texture-variants" container is a list of variant subcontainers with no standalone tags. Each variant subcontainer uses the following format. Each variant is numbered based on the subcontainer's tag name. These numbers are used to refer to specific variants from the asset's "Season-selector" container. Variant 0 is parsed from the default configuration of the KIND Groundtexture asset and does not need to be supplied explicitly in the "Texture-variants" container.


Contents

Supported Tags

Each variant subcontainer supports the following tags. Each tag is shown here with its default value.

 diffuse-texture           ""
 normal-texture            ""
 clutter-mesh-asset        <NULL>

diffuse-texture

The "diffuse-texture" tag specifies a Texture file located within the asset folder. See the article on KIND Groundtexture for a discussion on how this image is utilized.

normal-texture

The "normal-texture" tag specifies a Texture file located within the asset folder. See the article on KIND Groundtexture for a discussion on how this image is utilized.

clutter-mesh-asset

A ground texture can optionally reference a low polygon mesh (a "clutter mesh") and insert the mesh automatically as the ground is painted. The clutter-mesh-asset tag specifies the KUID of the mesh to use for clutter display. See the article on KIND Groundtexture for a discussion on how this mesh is utilized.

Texture-variants Example

A typical texture-variants container would look like this:

texture-variants
{
 0
 {
   diffuse-texture                     "default.texture"
 }
 
 1
 {
   diffuse-texture                     "winter.texture"
 }
}

A season-selector container is also needed to make use of the texture-variants container (1 means winter, 0 the other three):

season-selector
{
  season-range                          0.25,0.75
  
  branch-true
  {
    season-range                        0.25,0.5
    
    branch-true
    {
      output-season                     0
    }
    
    branch-false
    {
      output-season                     1
    }
  }
  
  branch-false
  {
    output-season                       0
  }
}

Categories

Personal tools