Changes between Initial Version and Version 1 of TextureFormat


Ignore:
Timestamp:
Sep 10, 2010, 4:16:17 PM (14 years ago)
Author:
Philip Taylor
Comment:

start documenting textures

Legend:

Unmodified
Added
Removed
Modified
  • TextureFormat

    v1 v1  
     1= Texture file format =
     2
     3Brief summary:
     4 * Textures should be in '''PNG format'''.
     5 * Textures must be '''power-of-two sizes''' (width and height must be 64, 128, 256, 512, etc; non-square sizes like 256x512 are fine too).
     6 * Textures go in an '''`art/textures/`''' directory (typically `binaries/data/mods/public/art/textures/`)
     7
     8== Compression ==
     9
     10PNG files are small on disk, but they expand to 32-bit raw RGBA format in video memory when they're loaded. Reducing video memory usage is important for performance, especially on lower-end hardware. DXTC (also known as S3TC) is a way to store compressed textures in video memory, in three different formats (DXT1, DXT3, DXT5). For example, a 512x512 texture is:
     11 * RGBA: 1024 kB
     12 * DXT1: 128 kB
     13 * DXT3: 256 kB
     14 * DXT5: 256 kB
     15Compression allows us to increase the number or size of textures by 4x or 8x without hurting performance. The tradeoff is that the compression is lossy, causing ugly artifacts in some textures.
     16
     17=== DXTn differences ===
     18
     19DXT1, DXT3 and DXT5 all store the RGB channels in precisely the same way. The only difference is the alpha channel. The [http://blog.wolfire.com/2009/01/dxtc-texture-compression/ Wolfire Games blog] (no relation to Wildfire Games) has some examples.
     20
     21 * DXT1: 1-bit alpha: good for textures that are all solid, or for UI elements with non-antialiased transparency masks. Generally unsuitable for non-solid world textures - even if the texture only needs 1-bit alpha, its mipmaps are likely to need semi-transparent pixels.
     22 * DXT3: 4-bit alpha: good for textures with a wide range of alpha values in a 4x4 block of pixels; bad for smooth alpha gradients.
     23 * DXT5: 3-bit alpha gradient: good for smooth gradients; fine for most of the cases where DXT3 is good. You should generally use this instead of DXT3.