setSunIntensity()

(info) Other great resources: Official JS API docs, Scripting Forum

setSunIntensity()

Change the lighting effects applied to game objects...

 

Syntax

setSunIntensity(aR, aG, aB, dR, dG, dB, sR, sG, sB);

Properties

Property

Type

Mandatory

Notes

Game Version

Property

Type

Mandatory

Notes

Game Version

aR

Number

Ambient Red light.

Game default: 0.5

3.2

aG

Number

Ambient Green light.

Game default: 0.5

3.2

aB

Number

Ambient Blue light.

Game default: 0.5

3.2

dR

Number

Diffuse Red light.

Game default: 0.5

3.2

dG

Number

Diffuse Green light.

Game default: 0.5

3.2

dB

Number

Diffuse Blue light.

Game default: 0.5

3.2

sR

Number

Specular Red light.

Game default: 0.8

3.2

sG

Number

Specular Green light.

Game default: 0.8

3.2

sB

Number

Specular Blue light.

Game default: 0.8

3.2

Return value

Does not return anything. Does not seem to throw any errors either, even if completely invalid values are passed in.

Notes

This video explains ambient, diffuse and specular lighting:

Currently this function only affects lighting applied to the PIE models of Game objects. It does not affect map terrain or base structure foundations.

To illustrate, an aR value of 100 was used to make all affected items bright red:

Example

// set default lighting levels setSunIntensity( 0.5. 0.5, 0.5, // ambient 0.5, 0.5, 0.5, // diffuse 0.8, 0.8, 0.8 // specular );