Textures

From TrainzOnline
Jump to: navigation, search

Textures in a Trainz context are the image files used by Trainz materials such as My_Material.m.tbumptex. Materials can have one or more textures. This page describes the basic requirements for textures used within Trainz.


Contents

Textures

General Requirements

Texture image files can be jpg, bmp or TGA (uncompressed), although TGA is preferred. Files are converted by the Trainz import process to .texture files on commit within Content Manager. The original source texture files are retained by Trainz and will be exported if the asset is opened for editing. Content developers should retain their own copies of texture files with their asset source data.

Texture Size

Texture sizes are sizes in pixels and not the actual size of the image file. Pixel dimensions must be a power of two and no larger than 2048 * 2048. The image dimensions need not be square but the maximum aspect ration is 1:8 e.g. 64 * 512.

Uniform (one colour) Textures

Single colour texture files should be avoided. Single coloured textures with an area of greater than 64 pixels are marked as an error by Content Manager. Single coloured textures with an area of less than or equal to 64 pixels are marked with a warning by Content Manager.

If a single colour block is required then, where practical, include the block within the main diffuse texture for the asset. It is usually easy to include a strip of coloured blocks within a main diffuse texture along one side of the texture.

An alternative is to use a notex material for any mesh required a single colour. Note that this can provide problems for reskinning since the colour of those meshes cannot be changed.

It is possible, using PEV's Images2TGA program or most any other image editors, to vary the shade of individual pixels in a single colour image. This will avoid the error or warning but the size of these images should be kept as small as possible. Note that using this technique may produce some odd colouring in meshes.

The technique used is dependent on the type of asset and the detail required. What works for one model may not work for another.


Shadow Assets and Textures

It is not necessary to have a texture for a shadow mesh as the shadow does not use the texture. Use a notex material instead and simply colour the mesh using the 3D software's mesh colouring facilities. This does work for Blender models and probably GMax and 3DS Max as well. Note that the Blender exporter will warn that the texture characteristics match the onetex notation. This warning can be ignored.


Normal Maps and Single Colours

(TBD )


Use of Textures Within Materials

See http://online.ts2009.com/mediaWiki/index.php5/Material_Types.


Creating Texture Files

Texture files can be created by a variety of image editors including photo editors. In addition to commercial or paid image software, there are also a number of quite good image editors available as freeware/shareware on the Internet. If you need an image editor, look for those that offer multiple layers and special effects plugins or addons. It is also an advantage to have an editor that has the capability to edit the alpha channel. If your image does not have that capability then PEV's Images2TGA utility program has the ability to send an alpha channel image to an external editor. See Images2TGA documentation for advice on how to set that up.


Hints for Creating Texture Files

  • The source for image or texture files can come from a variety of sources. You can either create your own or use images provided by others. In the latter case please ensure you observe any copyright that may exist for the image. There are some providers who will provide textures for a small fee for model making.
  • Use the layer capability of your image editor to add effects of your own such as smoke or smeared effects. Putting those effects in a layer means you can turn them on or off as needed for your final texture.
  • Texture files can often be created by baking colours applied to your 3D model within the 3D modelling program. This can be useful as a starting point for building a texture file. Baking textures can be a complex process but you can usually find video tutorials on the subject on the Internet.
Personal tools