.texture.txt Files

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m (more defaults)
 
m (1 revision)

Revision as of 23:58, 3 February 2010

Contents

Introduction

Files with *.texture.txt suffix and extension are used to configure texture behavior in Trainz. These files may also control how textures are processed by Content Manager. These files are located in the same folder as the source texture files, typically .bmp, .tga or .jpg, and make reference to them. These files are generated automatically by the exporter or importer but may be edited by hand when specialization is required.

TODO: Merge this document into the Texture file page and erase this page.


Syntax

Each token is specified on a new line. There is no white space on either side of the '=' sign. A empty value is sometimes valid. The syntax is:

<token>=<value>

Example:

Primary=WayCoolTexture.tga
Alpha=WayCoolTexture.tga
Tile=st
AlphaHint=masked
Anisotropy=16
MagFilter=linear
MinFilter=linear
MipFilter=linear

(Example only, not recommended settings)


Tokens

Here is a list of supported tokens. Any other values should not be used.


Primary

Specify texture file name

  • <texture name> - Primary texture. Filename including extension.


Alpha

Specify alpha channel for texture. Note that if there is only one 32bit file with RGB and A channels, this must still be specified with the same name used in Primary

  • <texture name> - Alpha texture, may be the same or different from the primary


Tile

Wrap texture addressing horizontally, vertically or both. Otherwise texture is clamped.

  • <empty> - (default) No wrapping
  • s - Wrap horizontally
  • t - Wrap vertically
  • st - Wrap both horizontally and vertically


Dimension

Number of dimensions the texture has. Not required since only 2D textures are currently supported.

  • two - (default) Two dimensional
  • cube - (unsupported)
  • volume - (unsupported)
  • one - (unsupported)


Compression

Compression format used by CMP. If this is not supplied, format is chosen automatically.

  • none - Do not compress. Warning: Uncompressed textures consume large amounts of memory and slow performance.
  • DXT1 - Suitable for opaque or alpha masked textures
  • DXT3 - Alternately the best for alpha blended textures if the texture contains sharp contrasts. Try DXT5 first.
  • DXT5 - Usually the best for alpha blended textures


Hint

Texture usage hint, for internal use only. Note this should NOT be used to try and disble mip mapping.

  • static - (default) Standard texture resource
  • dynamic - Texture will be modified in memory


NormalMapHint

Hint about texture being a normal map. Important to use as this will affect final texture quality. Compression, mip map generation and renormalization of XYZ (RGB) is effected.

  • none - (default) This is not a normal map
  • normalmap - This is a normal map


ModifyMap

Allows the texture to be modified when the texture.txt file is read. Currently this is to allow the green channel (Y axis) to be flipped for normal maps.

  • none - (default) Do not modify texture
  • flipgreen - flip green channel which is Y Axis of normal map


AlphaHint

Specify how the alpha channel is used. Affects final alpha quality. May also affect texture compression and mip generation.

  • opaque - (default with no alpha present) No alpha channel used.
  • semitransparent - (default with alpha present) Alpha blended
  • masked - Alpha masked


Anisotropy

Anisotropic sampling quality. The higher the number, the better the visual quality but at significant performance cost. Where texture quality is needed specify a higher value.

  • 1 - (default) No anisotropic filtering
  • 2 - Low
  • 4 - Medium
  • 8 - High
  • 16 - Very High


AutoMip

Auto mip map generation. Chris, is this depricated? CMP now generates mip maps at highest quality instead of game load/run time.

  • none - Don't generate mip maps
  • default - (default) Whatever the default method is
  • fastest - Attempt to improve load time at expense of quality
  • nicest - Attempt to improve quality regardless of time


MagFilter

Texture sampling filter used when texture is magnified

  • nearest - No blending with neighboring texels
  • linear - (game default) Blends with neighboring texels for smooth zoom effect
  • default - (default) Game default


MinFilter

Texture sampling filter used when texture is minified

  • nearest - No blending with neighboring texels
  • linear - (game default) Blends with neighboring texels for smooth shrink effect
  • default - (default) Game default


MipFilter

Texture sampling filter used on mip map selection

  • nearest - No blending with other mip maps
  • linear - (game default) Smooth blendig between mip maps (Note, operates independently but should be used in conjunction with anisotropic sampling)
  • default - (default) Game default
  • none - Disable mip map generation in CMP and use in game. Specifically for user interface elements.


Comments & Suggestions

  • hint is mentioned even though it is intended for internal use only, because it has been used and abused by well meaning people since its discovery. anisotropic should be used to improve texture quality and mipfilter=none should be used to disable mip mapping only for interface textures.
Personal tools