RFC: Texture Extensions

	Revision History
		11/18/05 - Initial Draft
		12/14/05 - Update for new seasonal texture concept
		 9/ 7/07 - Updated for DDS
		 6/ 3/08 - Updated for features in 902, tex paging moved.
		10/16/09 - Removed Normal Map RFC, productized in XP940

The X-Plane scenery system attempts to handle textures in a uniform manner; for example all textures may have night lighting overlays (_LIT variants), and may be PNG or BMP. This RFC proposes other possible texturing extensions. Implicit is that these would be available for any scenery texture unless otherwise noted.

Explicit Compression Control

This would be a command that would specify that a texture is not to be compressed, allowing authors to "protect" textures with sensitive alpha channels.

Lighting Masks

A lighting mask is a grayscale texture that indicates that artificial light is affecting part of the scenery. It overrides the default ambient light calculations, restoring a "daytime" look, similar to how the airplane landing light works.

Lighting masks are DIFFERENT from _LIT textures in that a lighting mask is an additive effect - to preserve details of the base texture, this bsae texture must be merged into the _LIT texture. The _LIT texture is essentially emissive light.

(Of course in many cases the effect of external artificial lighting can be simulated using lit textures, e.g. pretending the halo from a street lamp is really concrete that glows on its own.)

There is one case where lighting masks are particularly useful: when a repeating tiled texture is used, a _LIT texture is useless in two ways: it may repeat in an undesirable way, and if it didn't repeat, it would not align with the base texture, making it impossible to merge the base texture into the _LIT texture.

Lighting masks circumvent this by allowing a mask that changes the lighting calculations on the underlying pixels. This means a large general lighting mask can be applied to a small repeating texture.

Lighting masks would only be applicable to .pol files -- the lighitng mask would be a coordinate-placed texture over a repeating base.

Dataref-Driven Texture Selection

In this extension, X-Plane would select an image file for a texture from among variants using a dataref. The dataref could be a built-in sim dataref or one provided by plugins. This would allow for a number of features in one extension:

  • Seasonal textures (driven by the sim date dataref).
  • Weather-based textures (based on weather datarefs).
  • Changing of the plane livery based on plugin datarefs (this assumes object parts for planes).
  • Texture swap for cockpit objects (based on the electrical system datarefs).

Texture swap time would inherently be slow, due to the need to go out to disk and load a new texture while flying, and the possibility of having to swap many textures across the whole scenery system. This extension would not be appropriate for animation.

Dataref-driven texture selections would be allowed for any scenery element driven by a text file. This means terrain (ter), objects (obj), road networks (net), forests (for), beaches (bch) and facade (fac) failes.

Open Issue: what syntax or logical structure would be used to make dataref-driven texture selections?

Note: seasonal textures would be implemented via dataref-driven textures.

Animated Textures

X-Plane would load a QuickTime movie as a texture. The movie would be played in looping mode, resulting in animation in the sim.

Open Issue: QuickTime is not available under Linux.

Ben: This is probably a deal-breaker.

Open Issue: Can this be combined with other extensions like range-limited? Will this be a maintenance nghtmare in the rendering engine?

Ben: Probably they can be combined; this needs to be examined in more detail.

Open Issue: Can animation be halted under certain visual conditions? Which ones?

Ben: Textures are not objects - they do not naturally have spatial location in the sim. Range-based textures are essentially a one-use hack that violates this. On the other hand, it's not clear how you can turn off animation by distance without direct support; LOD won't help with this. Probably the use of movies will be very limited without some additional culling support. (The sim simply can't play that many movies simultaneously while you fly.)

Open Issue: Is the movie's sound played?

Ben: No! This is designed to be an animation extension - using it for sound would be very breakable. For example, imagine that the sim stops movie playback for off-camera movies to boost framerate. Sound would stop! Changes in the sim's algorithm to do this would cause different behaviors.