Web Update 19.10.2024

Displacement map and texture syntax

You are here:
Estimated reading time: 3 min

Displacement map, this is an extraction map from the environment, thanks to the black and white environment within the gray color correction, the displacement is rendered for more texture detail, but we have to be careful if it is a texture or an environment texture. Since the value setting is from 0-100, for the texture we will be satisfied with 1.0 to 5.0, these values are sufficient for stone or brick, for example.

Here we have four textures:

  • Diffusion map
  • Normal map
  • Ambient Map
  • Displacement map

Discplace = 1,0        

Discplace = 5,0

}
texture-variants
{
 0
 {
 diffuse-texture ""
 normal-texture ""
 parameters-texture ""
 albedo-detail-texture ""
 normal-detail-texture ""
 detailtexturescale 0.09
 }
 ...
}

detailtexturescale
specifies the scale value that is used for detail textures relative to the coordinates of the primary structure. 1.0 means that the detail texture uses the same mapping as the primary textures (which is basically meaningless), while numbers below 1.0 mean that the detail textures are mapped to a larger area at a lower text resolution, and numbers above 1.0 mean that the texture detail is mapped on a smaller area with a higher texel resolution. This tag is only relevant where detailed textures are used.

Primary = Texture.tga
Alpha = Texture-alpha.tga
Tile = st
AlphaHint = masked

Primary = specifies the file name of the image file representing the color (R, G, B) channels of the texture. All alpha channels in the image file are ignored. The resulting texture will have a pure white (100%) alpha channel.

The alpha channel image should be in grayscale. No file should contain an alpha channel. Both image files must be the same size.

Compression = dxt3

The setting indicates the use of a specific texture compression scheme. If you don’t have a certain effect in mind, don’t forget this tag. Valid options are currently ‘none’, ‘dxt1’, ‘dxt3’, ‘dxt5’.

NormalMapHint = normalmap

Allows the texture to be specified as a normal map. You must specify this option for normal maps. Valid options are ‘none’ and ‘normalmap’.

ModifyMap = flipgreen

Enables inverting the green color channel of the texture. Some programs, such as Autodesk 3ds Max, create normal maps with the Y-axis facing the opposite direction of what Trainz droppers expect. This option can be used to make the display effect look correct on the train. Valid options are ‘none’ and ‘flipgreen’.

AlphaHint = non-transparent
Allows you to force a specific alpha mode on a texture. Valid options are opaque (meaning the alpha channel is overwritten with pure white), ‘semitransparent’ (meaning the alpha channel is grayscale), and ‘masked’ (meaning the alpha channel is clamped to a pure black and white raster map based on a 50% threshold.) If you omit this, Trainz will provide the appropriate value for that marker based on the actual content of the alpha channel.

Tile = st

Indicates the ability of texture coordinates outside the range (0.0 .. 1.0) to be treated as valid coordinates on an infinitely tiled texture. When tilings are active, the coordinates that go through the right / bottom side of the texture are effectively taken back to the left / top side and so on. Valid options include ‘s’ (tile horizontally), ‘t’ (tile vertically), ‘st’ (tile both horizontally and vertically) and ‘none’ (do not print image).

MipAlgorithm = tendency towards opaque

The default mipmap generation algorithm tends to make transparent touches (such as fence links or tree leaves) more transparent at a distance. This occurs because multiple alpha texels in the high resolution image (100%, 0%, 100%, 0%) are blended with a single pixel in the lower mips (50%). The result is that the average opacity level remains the same, but the maximum value is reduced. Coupled with the fact that overlapping layers of semi-transparent textures don’t necessarily increase output transparency (a performance-related rendering limitation), the net result is that something that might be quite opaque up close can become spooky at a distance. An alternative “tend towards opaque” algorithm can be chosen to generate the mipmap, which defeats this problem by setting the opacity to maximum. This increases the average opacity for distant objects and has the side effect of making soft edges heavy and potentially “blocky”. It should only be used where the default algorithm gives decidedly suboptimal results.

nonpoweroftwo = 1
By default, all textures must have both width and height as multiples of two (eg 8, 16, 32, 64, 128, 256, 512, 1024, 2048), although they don’t have to be square. By setting the value “1” for the “nonpoweroftwo” button, this limitation can be reduced. This is currently considered experimental and may have unexpected performance, quality or functionality results. It is not recommended that end users use this format at the current time.
Was this article helpful?
Dislike 0 0 of 0 found this article helpful.
Views: 2
Alpinetrainz
Logo
Shopping cart