Panel Textures
General
This article describes X-Plane 10’s panel system, and its options for texturing and lighting panels and instruments.
Definitions
A panel is a rectangular image containing a collection of individual instruments as well as a panel background that shows behind them. X-Plane aircraft contain two panels, both of which are optional:
- The 2-d panel is used to draw a 2-d image of the interior of your aircraft when in “2-d” mode.
- The 3-d panel is used to create a Panel Texture that you then use to texture your aircraft’s 3-d objects .
The 2-d panel typically looks like a 2-d photograph of an aircraft, with transparent front windows and instruments below them; the 3-d panel is typically a tightly packed collection of instruments that need to be used as a texture atlas for the 3-d cockpit.
If your aircraft shows the 3-d cockpit even in 2-d viewing modes, you do not need to include a 2-d panel. If your aircraft does not have a 3-d cockpit, you do not need to include a 3-d panel. All aircraft should have at least one panel.*
Panels are saved as part of the .acf file format, and are edited via Plane-Maker’s panel editor screen. The locations and choices of instruments live inside the .acf format, but textures used to customize the panel are saved as .png files in your aircraft’s folder.
Instruments come in two flavors:
- Predefined instruments look like a real-world instrument, e.g. a gear handle or airspeed indicator. X-Plane comes with over 600 predefined instruments, covering a wide variety of cockpits; each predefined instrument comes with high quality default textures. You can build a panel out of predefined instruments without doing any image editing.
- Generic instruments are small lego bricks – each one does a single visual function (e.g. draw a needle or draw a number or draw a draggable handle). Generic instruments have a large number of customizable properties, and they display data from any dataref. Generic instruments are used to build truly custom displays with complete control over behavior. There are about ten different kinds of generic instruments, covering a range of drawing behaviors.
Panel Texturing and Layout
A panel consists of the following textures, in this order from “back” to “front”.
- The panel background is a large single image file that fills the entire panel; an alpha channel is use to make windows translucent. The size of the image file defines the size of the panel. All panels should be at least 1024 x 768 pixels if not bigger. The maximum panel size os 2048 x 2048 pixels. 3-d only: 3-d panel backgrounds should always have dimensions that are a power of 2.
- Each instrument has an instrument background texture, typically named after the instrument, e.g. alt_HM_dig.png. This texture sits on top of the panel background, and cannot be animated in any way . (X-Plane merges the instrument backgrounds into the panel background at load, so there is basically no performance cost to using background textures.) If you do not want to use a background, set its texture to 0% alpha. Instrument backgrounds are composited in the order they appear in Plane-Maker.
- 2-d only: The panel + instrument backgrounds are then lit by a single shadow + lighting map that should be the same size as the panel. This texture affects all backgrounds and can be used to simulate shadows from dashboards and small spill lights.
- Each instrument then has one or more instrument overlays ; instrument backgrounds have names like alt_HM_dig-1.png and alt_HM_dig_LIT-1.png. The suffix number is anything from -1 to -4; the exact layers used depend on the instrument. The _LIT version is optional – see instrument lighting below. Instrument overlays are drawn in the order they are listed in Plane-Maker, but all instrument overlays float over all backgrounds. Instrument overlays can be animated, including hiding and showing them under certain conditions.
There are some inherent limitations in this texturing system:
- Instrument backgrounds cannot be animated or lit. Therefore they are typically only used for part of the ‘backgrounds’ of instruments. When a solid element of the panel (e.g. the bezel around a steam gauge) must be animated or lit, some kind of overlay must be used.
- Instrument backgrounds are all entirely at the bottom of the stack of textures; any time overlapping layers are needed, overlays must be used.
- Therefore it is totally normal to use generic instrument overlays as ‘building blocks’ for more complex panels.
- 3-d only There is no lighting map for 3-d panels. Instead X-Plane 10 provides a powerful set of options for real live 3-d lighting for 3-d cockpits.
Texture File Names and File Locations
X-Plane looks for any texture (instrument background, instrument overlay, panel background, or for 2-d panel lighting map) in three possible places:
- For the 3-d panel, X-Plane looks in a folder named cockpit_3d in your aircraft’s folder.
- For the 2-d panel, X-Plane looks in a folder named cockpit in your aircraft’s folder.
- If X-Plane cannot find the desired texture in either location, it will look in Resources/bitmaps/cockpit for a default texture.
You can share instrument and overlay textures between the 2-d and 3-d panel; if X-Plane cannot find an instrument texture for the 3-d panel in cockpit_3d, it will look in your aircraft’s cockpit folder. The panel background cannot be shared, and the panel lighting map is 2-d only.
The panel background lives at this path:
- 2-d: cockpit/-PANELS-/Panel.png
- 2-d lighting maps: cockpit/-PANELS-/Panel-1.png, etc. -1 = shadow, -2, -3, -4 = overlay lights 1, 2 and 3.
- 3-d: cockpit_3d/-PANELS-/Panel.png
Pre-defined instrument paths vary by instrument, but will match the hierarchy you see in Plane-Maker. Tip: Control-P in the panel editor will copy the default X-Plane background and overlay textures for the selected instrument into your cockpit or cockpit_3d folder if they do not exist. You can then simply edit the .png files in photoshop.
Generic instruments have their texture names selected in the panel editor; they must be located within either:
- 2-d: cockpit/generic
- 3-d: cockpit_3d/generic
You can make sub-folders within your cockpit/generic and cockpit_3d/generic folders to organize your textures.
Panel Lighting
Panel lighting can be broken down into two types of lighting:
- Emissive lighting – this is the case where an element on the panel lights itself. An example is the gear down indicator light bulbs or the LED display on a radio stack. In both cases, you can see the element at night without shining a flash-light on it.
- External lighting – a light source shining onto an element from some other source. For example, if the map light or post light casts light on the gear handle (which is just a piece of plastic), we say the lighting on that gear handle is external. The sun is an example of external lighting too.
Emissive Lighting
Emissive lighting can be applied to any instrument overlay texture; precisely how this is done depends on the lighting mode of the instrument. The instrument’s lighting mode is set in Plane-Maker and can be set for each instrument.
Predefined Instruments: parts of predefined instruments (like the numbers on a radio stack may automatically be emissive; for the rest of the instrument, there are two lighting mode choices.
- Default (Swapped) – the instrument has no emissive lighting. You provide an overlay texture but no overlay _LIT texture.
- Additive – you provide an overlay and an overlay _LIT texture; the _LIT texture adds light to the panel in proportion to the instrument rheostat you pick for this instrument. This option is good for steam gauges that can be back-lit.
Generic Instruments: generic instruments never emit light automatically; you always set their lighting options via the lighting mode property in Plane-Maker’s panel editor. There are a number of choices for generic instruments:
- Mechanical – the instrument does not emit light. You provide only an overlay texture, no _LIT texture.
- Back-lit – you provide an overlay and an overlay _LIT texture; the _LIT texture adds light to the panel in proportion to the instrument rheostat you pick for this instrument. This option matches “additive” for predefined instruments. These are the only choices where you provide a _LIT texture.
- Glass – you provide only an overlay texture, but the entire overlay texture is treated as emissive only. This mode is good for glass displays and LCDs, where the device creates lights. The lighting rheostat for the instrument modulates the instrument brightness.
TODO: ref generic instrument specific docs.
An instrument overlay _LIT texture is only used in mechanical and additive lighting modes, and in both cases it adds lighting to your instrument overlay. For this reason you should not have an alpha channel on your _LIT instrument overlays. Simply stage the lit texture on a black background.
When using a regular generic instrument overlays in glass mode, always pick “Glass (Translucent)” or “Glass (Translucent, Auto Adjust)”; set up your overlay texture with a black background and X-Plane will add light. Do not include an alpha channel.
2-d Panel External Lighting
The 2-d panel can be externally lit using the panel background lighting maps. The three lighting map layers (-2, -3, -4) follow the panel brightness rheostats 1, 2 and 3; panel brightness rheostat 0 acts as a global fill light with no shape. All four light sources can have their RGB color set in Plane-Maker’s “Viewpoint” screen under the “Int Lights” tab.
These overlays have a few limitations:
- They act are not pixel-accurate on overlay textures.
- They do not respond at full framerate to rheostat changes.
Another option for external lighting is to simply “draw” the lighting into instrument lighting onto overlays, using emissive lighting to create fake external lighting. (This technique can work in 2-d for specific small parts of the panel but may not be practical for complicated 2-d panels.)
3-d Panel External Lighting
External lighting in 3-d is provided through 3-d mechanisms: global spill lights attached to objects or set up in Plane-Maker. For the most part, you should not try to add external lighting to your 3-d panel.
(Like in the 2-d panel case, you can choose to use emissive lighting on overlays to “bake” lighting effects directly into the panel; this can be effective some cases but hard to manage in others.)
- One exception: aircraft specially designed for home cockpits might only be used in full screen views; these aircraft might not need any panel at all.