<P>Firstly, create a directory <code>tracks/category/name</code> where <code>category</code> is one of <i>dirt, speedway, road, circuit</i> and <code>name</code> is the name of your track.</p>
<P>Create the track .xml file. You can take one of the available tracks to start with. The file shall contain one entry for the 3d description, which should be <code>name.ac</code></p>
<h2>Creating the basic .ac file</h2>
<P>For initial testing of your track, issue the command <code>trackgen -n name -c category</code>. See that the track is OK by loading it with torcs.
</p>
<h2>Creating shading</h2>
<P>To test shading, issue the command <code>trackgen -a -E 1 -n name
-c category</code> from the top level directory. The track step and
border step parameters in the Terrain Generation section of the xml
file define the complexity of the terrain generation. If it takes too
long, make them larger. This will create an elevation file,
<code>name-elv.png</code></P>
<P>It is possible to create a simple shading scheme with the gimp. Open the image, select <i>Filter &rarr Distorts &rarr Emboss</i>. Select the parameters and apply the filter. Save the file as <code>shadow2.rgb</code>. If it is not a power of 2 in size, you have to resize it so that it has dimensions (x,y)=(2<sup>a</sup>, 2<sup>b</sup>)</p>
<P>However this scheme is not very good. It does produce soft shadows, but it is not much different than the light produced by the light source in the .xml file. A possibility is to do the following. After you <i>Emboss</i> the image, select <i>Filters &rarr Blur &rarr Motion Blur</i>. Select an angle that is <i>360 - a</i>, where <i>a</i> is the angle that you have chosen for <i>Emboss</i>, if in the latter your elevation degrees was smaller than 90. If it was larger than 90, set angle to <i>a</i>. Select the appropriate length (between 10 and 50 is OK) and copy the image into a new buffer. Reopen the old image and place the new image as a layer on top of it. Now select either <i>Multiply</i>, or <i>Darken Only</i> and adjust the opacity to around 50. This should result in some shadows appearing to be cast from the sharper edges of your massif. Replace the previous shadows image with this one.
<P>Now do <code>cd tracks/category/name</code> and issue the command
<pre>cp name.ac name-bak.ac</pre> to have a backup of the original
track description. This can then be used to generate a shading file
that will use <code>shadow2.rgb</code> as a texture, with the following command:<pre>
accc +shad name-bak.ac name-shade.ac
</pre>
</p>
<P>Now you can combine the two descriptions into one using
If the output is too much for your terminal you can always redirect it to /dev/null
</p>
<P>Test your new track with torcs.
</p>
<h2>Creating elevation files</h2>
<P>It is possible to create elevation files by issuing the command
<code>trackgen -a -E x -n name -c category</code>, where <code>x</code> selects which elevation file should be generated.
<pre>
0: all elevatation files
1: elevation file of terrain + track
2: elevation file of terrain with track white
3: track only
4: track elevations with height steps
</pre>
Each one of those will be useful for some purpose. I personally use 1 and 3. Number 3 can also be used to create a track preview. It can also be used to get an idea of where the track is so you can take this into account when changing the elevation map. The procedure is as follows:
<p>Using either the track or terrain+track map as a template create a black and white image. The whiter a pixel is, the higher. Then save the images as <code>elevation-map.png</code>. You will then need to insert the following lines in the Terrain Geneartion section of <code>name.xml</code>
The maximum and mimimum altitude specify what the altitude corresponding to the brightest and darkest pixel in the image, respectively. You might need to fiddle around with that a bit until you get it right.
<P>Of course, as seen in the previous section you can use the elevation map that you have created to generate shadows.