The LightEnv class describes an in-game lighting environment, that consists of ambient light levels and sunlight configuration (direction and brightness of sun).

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

LightEnv Methods

LightEnv (Constructor)

  • Overview:
    • Instantiates a LightEnv object with default settings.
  • Syntax:
    • new LightEnv();
  • Returns:

A new LightEnv object with default settings.

LightEnv Properties

elevation

  • Overview:
    • 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.
  • Type:
    • double

rotation

  • Overview:
    • Direction of sun on the compass, in radians.
  • Type:
    • double

terrainShadowTransparency

  • Overview:
    • 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).
  • Type:
    • double

sun

  • Overview:
    • 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.
  • Type:

terrainAmbient

  • Overview:
    • Color of ambient light on terrain. All objects receive ambient light, independent of whether they are in shadow or which direction they are facing.
  • Type:

unitsAmbient

  • Overview:
    • Color of ambient light on models. All objects receive ambient light, independent of whether they are in shadow or which direction they are facing.
  • Type:

LightEnv Global Objects

lightenv

  • Overview:
    • Represents the current light environment. Change this object to experiment with light environment settings in real time.
  • Type:
    • LightEnv
Last modified 16 years ago Last modified on Feb 23, 2008, 4:18:58 AM
Note: See TracWiki for help on using the wiki.