Images2TGA Tutorial
Images2TGA Tutorial
This tutorial was originally written for John King's Trainz Texture2TGA that just performed the conversion. Now I
Resources News Letter. supply Images2TGA that has many more features.
Any 3d object or surface can be modelled as a series of TS2009, TS2010 and TS12 only support DXT compressed
triangular facets, on to which surface colouring (textures) textures which are made by conversion from image files
are added. All of this information is gathered together in a when assets are committed into the game by the Content
"mesh". The mesh contains all of the 3d geometrical data Manager program. If you wish to download or import an
needed to define the shape of the object as well as the asset from an earlier version and it has texture files in the
texture specifications to select surface colouring, and the Auran binary *.texture format, you will find that Content
texture mapping details to correctly place the texture images Manager will not import them. To succeed the textures must
on to the various portions of the surfaces. be converted to TGAs. I recommend using my
Images2TGA to convert to TGA files and generate the
The progressive mesh was the same as the indexed mesh required *.texture.txt files.
but with the addition of data that could simplify the mesh for
distant viewing. (lower the Level Of Detail). Auran later
chose to use multiple 'im' meshes instead of a single 'pm' for
their LOD method. What Can Images2TGA Do?
The Indexed Mesh contains references to 'textures' for 1. Display images. The program can open any image type
surface colouring. A 'texture' is a special form of image file used in Trainz and display the image and alpha image (if
with in-built features to achieve LOD and to control present) Trainz supports .texture, .TGA, .JPG, and .BMP
rendering within the game. The latest versions (TS2009 image files. All of these can be opened. All images can be
onwards) use DXT compression to reduce texture file size. viewed full size. Transparent sections can be viewed
DXT compressed images are now directly supported by against a selectable coloured background.
most video cards.
2. Convert to other formats. Once opened an image can
Reskinning be saved back to .TGA, .JPG or .BMP formats. There is no
need to save to .texture files as these are created when
Many users of Trainz wish to make their own versions of assets are committed into the game. When texture images
rolling stock or scenery based on existing assets in the are saved to TGA format the appropriate *.texture.txt file is
game. This can be done by recolouring the existing assets; generated automatically.
a process called 'reskinning'
3. Add or remove Alpha channels.
To reskin an asset the textures need to be edited. The
Auran texture format cannot be opened with normal imaging 4. Open the image or alpha image in you favourite
programs like Photo Shop, Paint Shop Pro, or the Gimp. image editor.
Hence I decided to provide an intermediate conversion to a
format that could be readily edited. I chose the TGA format 5. Merge an external image as an alpha channel.
because it supports an in-built Alpha channel for
transparency. Initially I provided a program called 6. Make bump and normal maps.
Setup
Opening a File.
To Open a File,start the program and click on the File menu. Transparency can be enabled to view masked or blended
Click on Open and the open file dialogue box will be alpha images against the window background. To view
displayed. The file extensions are filtered so only the correct transparent, right click on the main image and select Display
types are available. Transparent from the pop-up menu.
The tolerance input window will open and you can adjust the
colour tolerance with the spin-edit box.
Convert To TGA
The opened Image can be saved as a TGA, BMP or JPG The tolerance is the value plus or minus that is selected
file. If it has alpha data this will be lost if saved as BMP or from the RGB value (0-255) when you pick a colour (next
JPG. Hence the program automatically offers to save as step).. So if you enter 5, any value between plus 5 and
TGA when the image has been loaded from a texture. minus 5 of the select colour value will be made transparent..
(Black on the alpha image).
To save an image, click on the File menu and then click on
Save As. The Save File dialog will be displayed and you When you have accepted the tolerance value, the colour
choose the file type to save, and enter a file name. Then picker is enabled. Notice that RGB values appear next to
click the save button to complete the save of the file. the cursor and change as you move the cursor over the
main image.
When you save a *.texture to a TGA the program will
automatically make the appropriate *.texture.txt file. (See first image on the next page)
When ever you save the image file in your editor the file will
be updated in the Texture Viewer.
Also, do not change the size of the image.. It will not merge
with the other channel if you change the size.
Trawling
The Convert BMPs option enables conversion of BITMAP The files processed are listed in the text box below the
images to TGAs alpha image as the conversions progress. The program
keeps a log (named Trawl_Log.txt) of files found and shows
If none of the above options is set the progam will display a the actions taken on each file. The log is accessed from the
message and do no conversions. File menu and clicking on View Log. The log file
accumulates data every time trawl is started. The Log
Trawling must be launched from the command line should be deleted after large trawl conversions. A delete
(typically from the batch file in the 'Open With' menu of option is included in the File Menu.
Use the Images2TGA File menu, and "Open" to choose the You can now save the image as a TGA.
file.
If the primary image and the alpha image are different sizes
When the primary image is displayed in the left pane of the the merge will fail and no alpha image will be loaded. The
program window, click on File menu, then select Merge program will display a message about non matching image
Alpha Image. sizes.
You can now open the image in your editor and alter it to The normal maps produced by this utility are directly
give the desired bumpiness. Right click on the image and compatible with Trainz, so we only need the one additional
select “Edit” from the pop-up menu. entry in the texture.txt file:
NormalMapHint=normalmap
In the case the result was a follows: