0% found this document useful (0 votes)
130 views

Images2TGA Tutorial

This document provides instructions for using the Images2TGA tool to convert Trainz texture files to TGA format for editing and reskinning purposes. Images2TGA allows users to open, view, and convert Trainz texture and image files. It can also add or remove alpha channels, open images in an external editor, and perform other texture editing and conversion tasks to assist with reskinning Trainz assets. Detailed information is provided on installing and using the various features of Images2TGA.

Uploaded by

RUSMAN HIDAYAT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views

Images2TGA Tutorial

This document provides instructions for using the Images2TGA tool to convert Trainz texture files to TGA format for editing and reskinning purposes. Images2TGA allows users to open, view, and convert Trainz texture and image files. It can also add or remove alpha channels, open images in an external editor, and perform other texture editing and conversion tasks to assist with reskinning Trainz assets. Detailed information is provided on installing and using the various features of Images2TGA.

Uploaded by

RUSMAN HIDAYAT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Tools for Asset Repair by PEV Image by Alberte Zato

Images2TGA Revision 1.2 to suit Images2TGA Version 1.15


25 Septembert 2012

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.

Introduction I don't propose to write about reskinning. Sufficient to say


that many tutorials are available so I will just say that the
Trainz uses a render engine called Auran Jet to display and Images2TGA tool can assist in this process.
move objects within the simulator. Auran Jet supports a
suite of proprietory file formats that define 3d objects,
surfaces, animations, sounds and so on. Repairing Downloaded Assets

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.

© Peter Villaume (PEV) 2012 1


Using Images2TGA in Windows explorer and point it to this program before this
will work.
Installation
The name of the Last File opened is also displayed. Click on
that to re-open the file.
If you don't have this program, please download its installer
program (PEVImages2TGA_setup.exe) from my PEVSoft
The Exit option closes the program.
Download page.
Once the file is opened its image is displayed along with any
http://www.members.optusnet.com.au/~villaump/pevsoft.htm
alpha channel.

Run the installer and the program will be loaded on to the


Program Files area of your C: drive, along with a desktop
icon and an entry in the PEVSoft folder of your All Programs
menu.

Setup

Before attempting any conversions you should connect


Images2TGA to your favourite image editor (Photo Shop,
Paint Shop Pro, Gimp or what ever.)

To set up editing, open the Images2TGA program and click


on the 'Setup/Editor' in the main menu. You will be
prompted to locate your favourite image editor. An open file
dialog will appear allowing you to browse to your editor
program. Click on it to select and save its location for future
use. Full sized versions of the images can be viewed by right
clicking on either image and selecting Display Actual Size
“Setup/OpenWith” creates the 'OpenWith' macros for from the pop-up menu.
Content Manager for TS2009, TS2010 and TS12. This
allows you to run Images2TGA directly from the Content
Manager.

If you have installed Trainz TS2009, TS2010 and/or TS12 in


the default folders then this process is completely automatic.

If the “OpenWith” installer cannot find a Trainz installation it


will present a folder search dialogue window and ask you to
locate the installation. If you don't have that version
installed press the “cancel” button. Otherwise locate the
Trainz application folder.

In Content Manager you will find that you now have an


Open With option in the right click popup menu. Using this
option Images2TGA will automatically search the opened
asset folder and its sub folders for texture files to convert to
TGAs. All textures in the asset should be converted and
appropriate texture.txt files created.

I recommend, also, that you you make Images2TGA.exe the


program that opens *.texture files when you double click
them in Windows Explorer.

Opening a File.

The program can open Trainz Image files only. (.texture,


.TGA, .BMP or .JPG)

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.

Files can also be opened by double clicking in Windows


Explorer. You must add the .texture file extension to the list

© Peter Villaume (PEV) 2012 2


Creating an Alpha Mask
A masked alpha channel can be added or substituted for an
existing alpha image.

The mask is created by right clicking on the main image,


and selecting Create Alpha Mask from pop-up menu.

Note that the transparent portions of the image have a


checker board pattern in the background colour. As below:

The tolerance input window will open and you can adjust the
colour tolerance with the spin-edit box.

The background colour can be changed by right clicking on


the main image and selecting Transparent Background. A
colour selector will appear for you to choose a new colour.

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)

If you have lots of textures to convert to TGA's use the trawl


facility included in this program..

© Peter Villaume (PEV) 2012 3


Click on the colour that you want to be transparent and the Select Edit and your editor will open with the image in it
new alpha mask will appear in the Alpha image panel, as ready to edit.
below:
Similarly to edit the alpha image, right click on the alpha
image and so on.

When ever you save the image file in your editor the file will
be updated in the Texture Viewer.

Note: In your image editor, do NOT save as a different file


name, just press the save button.. If you save to a different
file name, the connection to the Images2TGA will be lost,
and it will not reload the saved image.

Also, do not change the size of the image.. It will not merge
with the other channel if you change the size.

Trawling

Images2TGA can be used to trawl (or search) for images to


convert. Before attempting to trawl, the type of images to
Adjust the tolerance and try again if you are not satisfied convert to TGAs must be set.
with the result.

Note that this process makes a masked alpha channel.


Masked alpha channels have only two values, black and
white or 0 and 255, in the colour data. If there is any pixel
with a value other than 0 or 255 the alpha channel is
considered blended.

For TS2009, you must be very careful to ensure that you


have only black or white in your alpha images. Any
intermediate values will hinder performance and in some
cases will not work in TS2009 native mode.

Editing the Main Image or Alpha Image

The image and alpha channel can both be opened for


editing in an image editor such as Gimp or Paint Shop Pro.

If you have connected Images2TGA to your editor as


explained in the SetUp section above, you can open your
editor from Images2TGA.
From the Options menu select the image type or types that
To edit the main image, right click on the image to bring up
you would like to convert to TGAs.
the pop-up menu.

© Peter Villaume (PEV) 2012 4


The Convert Textures option enables conversion of Trainz Content Manager 2 or 3), as detailed in the SetUp section
Binary textures (.texture files) to TGAs. above, and as shown in the image of Content Manager
The Convert Textures option is set by default when the below.
program is run for the first time after installation.
If you click on "Images2TGA.bat" in the Open With menu
The Convert JPGs option enables conversion of JPEG of Content Manager 2 or 3 the program will convert
images to TGAs. whatever textures or images it finds to TGAs with texture.txt
files.

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.

© Peter Villaume (PEV) 2012 5


Merging a Separate Alpha Image The new image should appear in the Alpha Image pane of
the program window, and the file definition should change
If there are two images that are used by the texture.txt file to from No Alpha to Masked Alpha or Blended Alpha.
make a composite transparent image, the two images can
be merged into a single TGA image with an alpha channel
for transparency.

Open the primary image defined by the 'Primary=' line in the


texture.txt file.

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.

Removing an Alpha Channel

To remove an alpha channel from a composite image, right


click on the alpha image panel and select "Remove Alpha
Channel" from the popup menu.

From the open file dialog choose the image nominated in


the 'Alpha=' line of the texture.txt file; in this case
cambridgealpha.bmp.

A confirmation box will be displayed.. select "Yes" to remove


the alpha channel, or "No" to retain it.

Making a Normal Map

A normal map is derived from a grey-scale bump map, so


firstly we load the main texture for an object into
Images2TGA. Take, for example, the texture image for the
RM55 rail motor:

See image on next page

© Peter Villaume (PEV) 2012 6


The grey scale bump map should now be saved for future
use.

After saving, choose “Make Normal Map” from the “File”


menu.

The image is then converted to grey-scale using the right


click menu and choosing “Grey Scale”.

The resulting image can then be used as the start of a bump


map where white features are protruding bumps and dark
ones are inset hollows.
The result is the typical blue-mauve looking normal map.

Don't forget to save the normal map as a TGA with “normal”


in the file name.

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:

© Peter Villaume (PEV) 2012 7

You might also like