GPL Track Creating - trk23dow - TEX

From Grand Prix Legends Wiki
Jump to: navigation, search

Authored by the GPLEA


<trackname>.TEX - Texture Mapping

In order for trk23dow to map the right textures to the right polygons, you must create a <trackname>.TEX file that relates to the values specified in your TRK.


Surface Subtypes

By now you should understand the different TRK surface types, but this will only let you define 1 texture per surface type- hardly a graphically pleasing track. To overcome this, the Unknown3 value in the TRK Walls is used as a surface SubType value, letting you have e.g. Asphalt 0, Asphalt 1, Grass 42, Armco 4948583, or whatever (maximum value of 2^32-1).

That .TEX File Then...

Here are the first few lines from a .TEX file:

0 0 0 10.0 10.0 error

1 0 0 10.0 10.0 asphalt

1 1 0 10.0 10.0 road

1 2 0 10.0 10.0 run

1 3 0 10.0 10.0 asf_shw

1 4 0 10.0 10.0 asp_sl

1 5 0 10.0 10.0 asp_sr

2 0 0 15.0 15.0 dirt

2 0 1 20.0 20.0 dirt

2 0 2 20.0 20.0 dirt

2 0 4 20.0 20.0 dirt

2 0 5 20.0 20.0 dirt


The first number in each line is the surface type - 1=asphalt, etc.

The second number in each line is the surface subtype - the value corresponding to the Unknown3 value in the TRK.

The third number is the 'side':


0 = normal texture, mapped on to the top of the wall

1 = vertical surface - e.g. side of armco

2 = upper ground-level polygon - e.g. top of armco

3 = ground-level, reflected - for when the track is visible from underneath.

4 = front of the wall (longitudinally)

5 = back of the wall (longitudinally)

6 = ceiling - e.g. the inner-top of a tunnel


The fourth number is the longitudinal scaling value - e.g. the asphalt texture will be mapped every 10.0 metres.

The fifth number is the lateral scaling value - (left-right).

The last part is the MIP name to use.

Note the first line - this is 0 0 0 10.0 10.0 error. Here you should define a texture to be used in case you forget to define a texture for any surface.subtype combinations. Make it a texture that you can easily spot in GPL, so you can work out where the problem lies.

See how surface type 2, subtype 0 has five textures mapped to it. This is because somewhere in the TRK, surface 2, subtype 0 has been given height, to make it into a vertical wall.

If you use any of the Unknown4 flags to change the texture mapping, the scale values defined in the .TEX file are overridden.

Updated 7-Jan-2001

Transferred to the wiki: 19.04.2009