Personal tools

Panel Regions

From X-Plane Wiki

Jump to: navigation, search

Panel regions are a new feature of X-Plane 9 that improves 3-d cockpit performance and enables real 3-d lighting.

Contents

When Should I Use Panel Regions

Use panel regions whenever you want real 3-d lighting on the panel-textured part of your 3-d cockpit. In X-Plane 930 this is a good idea for virtually any new aircraft. If you do not use panel regions, the 3-d spot lights will not affect your panel.

How Many Regions Should I Use

Here are the rules for regions in priority order:

  1. Avoid regions larger than 1024x1024
  2. Minimize the total area of the sum of all regions. (So: 512x1024 + 1024x1024 = 1572864 pixels, even if they overlap!
  3. Use the smallest number of regions while meeting the above rules.

Examples:

  • You have a 2048 x 1024 panel. Use two 1024x1024 regions. (Rule 1.)
  • You have a 1024 x 1024 panel, and you need to use 3/4 of it. Use two regions (1024x512, 512 x 512) to avoid having a region over the unused area. (Rule 2.)
  • You have a 1024 x 1024 panel, and you need all of it. Use one 1024x1024 region. (Rule 3.)

Limits of Panel Regions

Panel regions have the following limitations (not present for regular panel texturing):

  • The alpha channel is not available. That is, the transparent parts of your 2-d panel will not be transparent in your object.
  • The dimensions of the panel region (but not the offset) must be a power of 2.

Why Do Panel Regions Exist?

This section is only for those curious about the guts of X-plane - you don't need to read this to use panel regions.

The original panel texturing system has three performance problems:

  • Panels do not have to be power-of-2. The panel texture system rounds up the texture to a power of 2.
  • Because the panel might be very large, the total area of panel texture can be very large. (Combine this with the power of 2 problem and you can see that a 1280x1280 panel makes a 2048x2048 panel texture!!!)
  • Panel textures have an alpha channel for the windows. This means a slower pixel shader when the texture is used and extra code on older hardware when the texture is updated.

Panel regions represent a "clean slate" for the panel code. We wanted to add real 3-d lighting to the 3-d cockpit, but most airplanes using the panel texture have added pre-rendered lighting effects to the panel to compensate for the lack of 3-d lighting in version 8. We tried enabling 3-d lighting on the panel texture in the v900 beta process, but the feedback was universal: in almost all cases our 3-d lighting and the pre-made lighting effects clashed, producing ugly results.

Panel regions simultaneously "signal" to x-plane to use an entirely different, NEW rendering system that uses 3-d lighting and at the same time (via the new restrictions) avoids the performance problems of the old panel texture.

Navigation