SetGamma

Category: Global
Since engine version: 4.9.1.0 GWE

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

void SetGamma (int dwClr1, int dwClr2, int dwClr3, int iRampIndex);

Parameters

dwClr1:
Adjusting darker colors. Default RGB(0,0,0) for no adjustment.
dwClr2:
Adjusting medium colors. Default RGB(128,128,128) for no adjustment.
dwClr3:
Adjusting brighter colors. Default RGB(255,255,255) for no adjustment.
iRampIndex:
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:

iRampIndex 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 blue hue to the game
See also: RGB, ResetGamma
Sven2, April 2002