Texture Compression

This article discusses how texture compression affects your textures.

= What Is Texture Compression =

All images that are used for 3-d modeling in X-Plane become textures on the video card. A compressed texture is a texture that has been specially encoded to reduce the amount of VRAM it requires. Texture compression will reduce visual quality, but it will also reduce VRAM use.

X-Plane supports S3TC texture compression via three formats: DXT1, DXT3, and DXT5. (See below for more details.)

= Why Use Texture Compression =

(Note: each time the user reduces X-Plane's texture resolution setting one setting from the maximum, most textures are reduced in size by a factor of 2. So if the user sets "high" resolution, which is two settings down from the highest, a 2048 x 1024 texture will be reduced to a 512 x 256 texture.)

The main reason to use texture compression is to save VRAM. If a user's computer is constrained by the amount of VRAM, compressed textures can reduce VRAM use enough for the user to increase X-Plane's overall resolution. In other words, in some cases it is better visually to save VRAM by compressing textures than by making them smaller.

= What Textures Are Compressed =

Most textures in X-Plane can be compressed. There are a few exceptions, however:
 * Normal maps should not be compressed, because the compression algorithms severely damage the normal map.
 * Gray-scale textures cannot be compressed. (These are rare in third party airplanes/scenery.)
 * Instruments and the 2-d panel background should not be compressed.
 * The cockpit object's texture is exempt from compression, to preserve readability. (You can put labels and other fine details into this texture to protect them.)

= Using Texture Compression via DDS Files =

The user can enable texture compression in X-Plane's rendering settings; this will cause X-Plane to compress any texture that can be compressed (see above for the exempt textures).

However, you can achieve better results by pre-compressing your textures yourself, using a tool like XGrinder. Tools that pre-compress textures take longer to run, but produce higher quality output than X-Plane can while the user is flying. The quality of compressed textures depends on the encoding algorithm, so pre-compressing textures can be a win.

Use the DDS file format to store compressed textures. DDS can contain a compressed image in one of three compression schemes: DXT1, DXT3, or DXT5.
 * DXT1 contains 1-bit alpha; use DXT1 for textures that don't contain alpha information or contains only 100% opaque/100% transparent alpha. DXT1 gives the smallest size in VRAM.
 * DXT3 contains a 4-bit uncompressed alpha channel with a compressed image. Use DXT3 when your image contains alpha values that must be precise in their frequency.  For example, if you are using alpha to make a chain-link fence with blending disabled (so the alpha cuts out the chain links), use DXT3 to preserve the shape of the fence.
 * DXT5 contains a compressed alpha channel and a compressed image. This will yield more accurate alpha values but may contain some frequency artifacts.  Use DXT5 when it is important that the overall level of alpha be accurate but the location of the alpha is not important.  (For example, a soft blend of translucency to put some 'reflection' on a window might look better with DXT5 because the alpha will be smoother.)

X-Grinder will let you select which DXT compression to use. If you pick "auto-pick compression" then it will use DXT1 for RGB images and DXT5 for RGBA images.

Generally you should not use the DDS file format for any textures that are exempt from compression. DDS files are illegal for the 2-d instrument/panel system.