Index       Renderer

trap_R_AddLightToScene

Description

Prototype

    void trap_R_AddLightToScene(
        const vec3_t org,
        float intensity,
        float r,
        float g,
        float b
    );

Parameters

Remarks

r/g/b is the colour data of the light (normalized, so the highest value, 255, is 1.0)
This function will add a light to the game at org, which has a radius of intensity units, and the colour data which is shown in the variables r, g, and b. The highest number for an RGB index is 255, but in Quake 3 the colour's index is divided by 255 to give a normalized value.

Say I want to make a purple light. The colour data for purple in RGB is 255,0,255. So the normalized values for this colour are:

255/255 = 1.0
0/255 = 0.0
255/255 = 1.0

So to add a purple light at the vector x, and radius 2.4 I would write:

trap_R_AddLightToScene( x, 2.4, 1.0, 0.0, 1.0 );

Return value

This function has no return value.

See also

Author(s)

Nith Sahor


QuakeIII trap calls reference