| 1 | The !LightEnv class describes an in-game lighting environment, that consists of ambient light levels and sunlight configuration (direction and brightness of sun). |
| 2 | |
| 3 | The currently active !LightEnv object is exposed as a global property, so you can change e.g. the height of the sun with a command like ''lightenv.elevation = 0.4'' |
| 4 | |
| 5 | = !LightEnv Methods = |
| 6 | |
| 7 | == !LightEnv (Constructor) == |
| 8 | * '''Overview:''' |
| 9 | * Instantiates a !LightEnv object with default settings. |
| 10 | * '''Syntax:''' |
| 11 | * new !LightEnv(); |
| 12 | * '''Returns:''' |
| 13 | A new !LightEnv object with default settings. |
| 14 | |
| 15 | = !LightEnv Properties = |
| 16 | |
| 17 | == elevation == |
| 18 | * '''Overview:''' |
| 19 | * Height of the sun above the horizon, in radians. For example, an elevation of PI/2 means the sun is straight up, while an elevation of 0 means the sun is on the horizon. |
| 20 | * '''Type:''' |
| 21 | * double |
| 22 | |
| 23 | == rotation == |
| 24 | * '''Overview:''' |
| 25 | * Direction of sun on the compass, in radians. |
| 26 | * '''Type:''' |
| 27 | * double |
| 28 | |
| 29 | == terrainShadowTransparency == |
| 30 | * '''Overview:''' |
| 31 | * Fraction of diffuse light that reaches shadowed terrain. A value of 0.0 means shadowed polygons get only ambient light, while a value of 1.0 means shadows don't have any effect at all (because all diffuse light reaches points that lie in shadow). |
| 32 | * '''Type:''' |
| 33 | * double |
| 34 | |
| 35 | == sun == |
| 36 | * '''Overview:''' |
| 37 | * Color of sunlight as a vector, where XYZ corresponds to RGB. In other words, the X coordinate of the vector is the red component of the sunlight color, Y is green and Z is blue. |
| 38 | * '''Type:''' |
| 39 | * [wiki:Exposed_Vector3D_Functions Vector3D] |
| 40 | |
| 41 | == terrainAmbient == |
| 42 | * '''Overview:''' |
| 43 | * Color of ambient light on terrain. All objects receive ambient light, independent of whether they are in shadow or which direction they are facing. |
| 44 | * '''Type:''' |
| 45 | * [wiki:Exposed_Vector3D_Functions Vector3D] |
| 46 | |
| 47 | == unitsAmbient == |
| 48 | * '''Overview:''' |
| 49 | * Color of ambient light on models. All objects receive ambient light, independent of whether they are in shadow or which direction they are facing. |
| 50 | * '''Type:''' |
| 51 | * [wiki:Exposed_Vector3D_Functions Vector3D] |
| 52 | |
| 53 | = !LightEnv Global Objects = |
| 54 | |
| 55 | == lightenv == |
| 56 | * '''Overview:''' |
| 57 | * Represents the current light environment. Change this object to experiment with light environment settings in real time. |
| 58 | * '''Type:''' |
| 59 | * !LightEnv |