Dynamic lighting has been a feature of X-Plane for about a decade, beginning with X-Plane 9's landing light spill on aircraft. This has since been expanded to allow dynamic lighting to be used in many applications, called global illumination in X-Plane 10. In addition, V10 also introduces HDR rendering capabilities. For X-Plane 11, the way light is rendered is further improved with new rendering alongside PBR and a redeveloped lighting model.
There are three main types of light usable in X-Plane: Named Lights, Parameterised Light, and Custom Light
NAMED LIGHTS (LIGHT_NAMED):
PARAMETERISED LIGHTS (LIGHT_PARAM):
CUSTOM LIGHTS:
THIS SECTION IS REWORDED AND REFORMATTED FROM THE X-PLANE DEVELOPER BLOG
You may insert lights through opening your 3d object through a text editing program. Most developers uses parameterised lights, as it gives off flexibility in adjusting your spills (but lacks the ability for custom billboard textures, which will be covered in Custom Lights).
In a named light, the developer is limited to a pre-built in default billboard light, and the following three values determining the X-Y-X position. In this example, the named light is "obs_red_night":
LIGHT_NAMED obs_red_night -0.68 0.39 0
1. LIGHT NAME: LIGHT_NAMED
2. TYPE OF LIGHT: obs_red_night
3. X-Y-Z POSITION: First 3 numbers: -0.68 0.39 0
are the coordinates (this light is 0.39 meters above our object origin and 0.68 meters to the right).
__________________________________
In a standard parameterised light, normally there are two lines: one configuring the appearance of the billboard texture, and the second defining the dynamic light properties. Most applications in scenery uses the parameterised light called "full_custom_halo":
LIGHT_PARAM full_custom_halo 0 20 0 1 0.5 0.5 1 50 0 -1 0 0.5 sim/graphics/animation/lights/airplane_navigation_light_dir
1. LIGHT NAME: LIGHT_PARAM
2. TYPE OF LIGHT: full_custom_halo
3. X-Y-Z POSITION: First 3 numbers: 0 20 0
are the coordinates (this light is 20 meters above our object origin).
4. RGBA COLOUR: 1 0.5 0.5 1
(100% red, 50% yellow, 50% green, 100% brightness), so it's a very light red. RGB colours for spills are in linear space, so some experimenting is necessary to perfect the colours.
5. SIZE IN METERS: The size is 50
meters (a huge light throw)
6. ANGLE OF DIRECTION: 0 -1 0
(straight down).
7. DATAREF: sim/graphics/animation/lights/airplane_navigation_light_dir
to give custom animations/effects
0.5 is the "semi-width" of the cone - 60 degrees in this case. Basically cosine (cone width * 0.5) gives you this width parameter, or pass 1.0 for an omnidirectional light.
The billboard line are as follows:
LIGHT_PARAM sodium_flood_BB 0 20 0 0 -0.5 -1 4
The same structure applies:
1. LIGHT NAME: LIGHT_PARAM
2. TYPE OF LIGHT: sodium_flood_BB
3. X-Y-Z POSITION: First 3 numbers: 0 20 0
are the coordinates (this light is 20 meters above our object origin).
4. RGBA COLOUR: 0 -0.5 -1 4
(0% red, 50% blue, 50% magenta, 400% brightness), so it's a very yellow/orange tint.
__________________________________
Custom Lights further extends the flexibility of Parameterised lights by giving you the freedom to use your own billboard texture.
LIGHT_CUSTOM 0 20 0 1 0.5 0.5 1 5 sim/graphics/animation/lights/airplane_navigation_light_dir
1. LIGHT NAME: LIGHT_CUSTOM
2. X-Y-Z POSITION: First 3 numbers: 0 20 0
are the coordinates (this light is 20 meters above our object origin).
3. RGBA COLOUR: 1 0.5 0.5 1
(100% red, 50% yellow, 50% green, 100% brightness), so it's a very light red. RGB colours for spills are in linear space, so some experimenting is necessary to perfect the colours.
4. SIZE IN METERS: The size is 5
meters
5. TEXTURE COORDINATES: 0.5 1 1 0.5
(texture map is top right corner)
6. DATAREF: sim/graphics/animation/lights/airplane_navigation_light_dir
to give custom animations/effects
<s1> <t1> <s2> <t2>
You determine the coordinates of the light billboard texture (note that the custom light sits in the same texture file as your object). The values are fractions from 0 to 1.
<s1> <t1> determines your first point
<s2> <t2> determines your second point
s: Horizontal coordinates
t: Vertical coordinates
so in the example: 0.5 1 1 0.5
The first coordinate sits on the middle of the texture map horizontally, and lies on the top edge of the map boundary.
The second coordinate sits at the end (right side) horizontally, but sits in the middle of the map's length vertically.
NORTH: -0.00 -1.00 -0.50
SOUTH: 0.00 -1.00 0.50
EAST: 0.50 -1.00 0.00
WEST: -0.50 -1.00 0.00