SetGamma

Category: Global
Since engine version: 1.0 OC

Description

Sets a gamma ramp. Using gamma ramps, the global light situation of the game can be adjusted by assigning an individual data table to each color channel from which a new brightness value is read. By doing this you can strengthen chosen color ranges, darken or lighten the complete game or even invert light and darkness.

Syntax

bool SetGamma(int color1, int color2, int color3, int ramp_index);

Parameters

color1:
Adjusting darker colors. Default RGB(0,0,0) for no adjustment.
color2:
Adjusting medium colors. Default RGB(128,128,128) for no adjustment.
color3:
Adjusting brighter colors. Default RGB(255,255,255) for no adjustment.
ramp_index:
0-7: index of the gamma ramp to be changed. There are eight gamma ramps which are applied subsequently. In this way, e.g. global time-of-day objects can modify the global lighting situation without conflicting with secondary lighting effects such as a lightning flash.

Remark

The eight gamma ramps have the following effects:

ramp_index Function
0 Scenario global value
1 Climate/Seasons (will be used internally if activated in the scenario)
2 free
3 Day/Night
4 free
5 Lightning
6 Magic Effects
7 free

Generally, lower ramp indices mean longer color changes; higher indices mean shorter effects.

Example

SetGamma(RGB(50,0,0), RGB(140,100,100), RGB(255,220,220));
Adds a light red hue to the game.
See also: RGB, ResetGamma
Sven2, 2002-04