# Car's Shadows for 1.3.x

This tutorial explains how to generate shadows for the cars with "The Gimp".

First you'll have to create an RGB (uncompressed) blank image (128x128) that you'll name "shadow.rgb" in the car directory:

    cars/acura-nsx-sz
    cars/acura-nsx-sz/acura-nsx-sz.xml
    cars/acura-nsx-sz/acura-nsx-sz.rgb
    cars/acura-nsx-sz/tex-wheel.rgb
    cars/acura-nsx-sz/acura-nsx-sz.acc
    cars/acura-nsx-sz/acura-nsx-sz-lod1.acc
    cars/acura-nsx-sz/acura-nsx-sz-lod2.acc
    cars/acura-nsx-sz/shadow.rgb

Then edit the "car.xml" ("acura-nsx-sz.xml" in our example) file to add the following line to the "Graphic Objects" section:

Now launch a race with a player using the car you're modifying, and hit the "P" key before the race starts.
Select the "F5" view and zoom (with "<" and ">" keys) to have a good view of the car and take a screen-shot with "F12".
The image is saved in the torcs runtime directory.

Select the white area and create a new image with the selection Right-Click and "Script-Fu->Selection->To Image".

Now use the "Fuzzy select" tool to select the white areas:

The result is:

Now cut the select area with Control-X:

Now select the car with Right-Click and "Layers->Alpha to Selection", then select the "Bucket Fill" tool:

Paint the car in black:

Invert the selection with "Control-I" and paint it too:

Then cut the newly painted area with "Control-X" (this is to have the transperent color made of black).

Now blur the shadow with Right-Click and "Filters->Blur->Gaussian Blur (RLE)..."

The result is:

Now scale the image to 128x128 with Right-Click and "Image->Scale Image..."

The result is:

Set the image transparency to 80%

The result is:

Now save the image in RGB uncompressed format:

important:

The result is:

Last modified: Sun May 25 11:40:56 CEST 2003