This article lists the ways you can create lighting billboards in X-Plane for scenery and airplane use. They are listed in order of decreasing abstraction. Generally you should:

  • Use the highest level of abstraction that meets your needs. This gives X-Plane the best chance to optimize rendering of your light billboards.
  • Do not “abuse” an abstraction. For example, if you need blue lights for a police station, don’t use taxiway lights; taxiway lights are for airports only, and using them implies an airport surface area.

apt.dat Lights

The simplest way to create lighting is using an apt.dat airport layout; the apt.dat file format supports most common lighting fixtures found around an airport.

You can edit apt.dat lighting using WorldEditor[1]. More information on the apt.dat format can be found at //data.x-plane.com/

There are a few lighting types that are much easier to create with an apt.dat than any other file format. In particular, sequenced flashing lights like the “rabbit” in an approach lighting fixture get their sequencing information from the apt.dat loading code. If you use the “rabbit” art assets using an overlay DSF (see below) you will not be able to create the flashing sequence.

apt.dat lights have a very high level of abstraction. For example, runway lights automatically change their color based on distance to the threshold and their fixture type (flush vs. above-ground) based on the presence of taxiways.

DSF Overlays

For more control of lighting, use a DSF overlay[2] to place objects. The objects in turn can create the desired billboard.

Because all of the objects used to model airports (from apt.dat files) are also available via the X-Plane library system[3], you can gain more additional control of object placement using a DSF overlays.

For example, if you need taxiway centerline lighting with a spacing other than what the apt.dat file automatically generates, you can individually place taxiway centerline lights from the library using an overlay DSF.

You can create DSF overlays with OverlayEditor[4] (third party) or WED 1.1 (once it goes beta – alpha as of this writing).

With Library Art Assets

The simplest way to use an overlay DSF is to use lighting objects already present with the sim. The main use for this would be to customize placement of airport lighting beyond what the apt.dat file can do. See the notes above about the limitations of using “sequenced” lights.

With Custom Objects

The next level of customization is to create your own OBJ files, which lets you model the light fixture in 3-d. There are a number of ways to get billboards for your 3-d models. Custom objects are always placed into the scenery system via a DSF overlay.

You can create objects with plugins/scripts for Blender or ac3d[5].

With Named Lights

The simplest way to place a billboard into your custom object is to use a named light. Named lights provide access to X-Plane’s built-in shaders and light billboard textures. Named lights are the best choice when you need to place a lot of lights.

With Custom Lights

A custom light is a light billboard in an object where you provide all of the parameters for the light’s operation. The custom light’s texture comes from the OBJ. The custom light has nine configurable parameters and a dataref. Thus you can customize its operation in three ways:

  1. No dataref – if you do not provide any dataref, the 9 parameters are used as-is.
  2. X-Plane dataref – X-Plane comes with a number of datarefs for light animation. See sim/graphics/animation/lights/[6]
  3. Plugin-dataref – you can provide your own dataref to modify lighting parameters in a plugin[7]. This gives you complete control of the light from code.

Plugin Drawing Callback

At the lowest level, you can simply install a drawing callback using XPLMRegisterDrawingCallback, and then draw your own billboards using any OpenGL code you want.

Leave a Reply

Your email address will not be published. Required fields are marked *

Please do not report bugs in the blog comments.
Only bugs reported via the X-Plane Bug Reporter are tracked.