→Sample Files: wrong directory
(→Sample Files: wrong directory) |
|||
| Line 23: | Line 23: | ||
=== RAW compression === | === RAW compression === | ||
==== RAW1 ==== | |||
If <tt>compression</tt> is set to 1, each mipmap is stored as an array of 8-bit values, one per pixel, left to right, top to bottom. Each value is an index to the palette. | If <tt>compression</tt> is set to 1, each mipmap is stored as an array of 8-bit values, one per pixel, left to right, top to bottom. Each value is an index to the palette. | ||
If <tt> | If <tt>alpha_bits</tt> is greater than 0, an alpha channel will immediately follow the image data, and comes in 1, 4, and 8 bit varieties. The 1 and 4 bit versions have multiple values packed into a single byte, with the least significant bit belonging to the first packed value. | ||
With the <tt>compression</tt> set to 3, each mipmap contains | ==== RAW3 ==== | ||
With the <tt>compression</tt> set to 3, each mipmap contains what appears to be 32 bit BGRA data. <tt>alpha_bits</tt> seems to represent a set of bit flags rather than depth, as all images of this type seem to have 4 bytes per pixel regardless of depth, and it has been seen to exceed 8. Their meaning is unknown. | |||
=== DXTn compression === | === DXTn compression === | ||
| Line 37: | Line 42: | ||
==== DXT1 ==== | ==== DXT1 ==== | ||
If <tt> | If <tt>alpha_type</tt> is 0, then DXT1 compression is used. | ||
Each block is 64 bits and begins with two 16 bit values, and are used to derived a 4 color palette. | Each block is 64 bits and begins with two 16 bit values, and are used to derived a 4 color palette. | ||
| Line 43: | Line 48: | ||
The values are interpreted as 565 RGB colors, with the least significant bits corresponding to blue, to create the first two colors in the palette. | The values are interpreted as 565 RGB colors, with the least significant bits corresponding to blue, to create the first two colors in the palette. | ||
If the first value is less than or equal to the second, the final entry of the palette is reserved | If the first value is less than or equal to the second, the final entry of the palette is reserved. If <tt>alpha_bits</tt> is 0, the reserved color is black. If <tt>alpha_bits</tt> is 1, the reserved color is transparent. | ||
The remaining colors are created by interpolating between the first two colors in the palette. | The remaining colors are created by interpolating between the first two colors in the palette. | ||
The remaining 32 bits are 16 2-bit values acting as a lookups to specify the colors in the block. | The remaining 32 bits are 16 2-bit values acting as a lookups to specify the colors in the block. | ||
==== DXT3 ==== | ==== DXT3 ==== | ||
If | If <tt>alpha_type</tt> is 1, then DXT3 compression is used. | ||
Each block is 128 bits and begins identically to DXT1, except that no special color is reserved in the palette. | Each block is 128 bits and begins identically to DXT1, except that no special color is reserved in the palette. | ||
| Line 78: | Line 77: | ||
The remaining 64 bits are identical to DXT1, except that no special color is reserved in the palette. | The remaining 64 bits are identical to DXT1, except that no special color is reserved in the palette. | ||
=== Sample Files === | === Sample Files === | ||
| Line 92: | Line 87: | ||
| GLUES\LoadingBar\Loading-BarGlow.blp || RAW1 || No alpha | | GLUES\LoadingBar\Loading-BarGlow.blp || RAW1 || No alpha | ||
|- | |- | ||
| | | CURSOR\Attack.blp || RAW1 || 1-bit alpha | ||
|- | |- | ||
| | | CURSOR\Buy.blp || RAW1 || 8-bit alpha | ||
|- | |- | ||
| Icons\Trade_Alchemy.blp || DXT1 || No alpha | | Icons\Trade_Alchemy.blp || DXT1 || No alpha | ||
| Line 118: | Line 113: | ||
| Textures\SunGlare.blp || RAW3 || alpha_bits=136 | | Textures\SunGlare.blp || RAW3 || alpha_bits=136 | ||
|- | |- | ||
| TILESET\Terrain Cube Maps\oilslickenvA.blp || RAW3 || alpha_bits=1 | | TILESET\Terrain Cube Maps\TCB_CrystalSong_A.blp || DXT1 || width=768 | ||
|- | |||
| TILESET\Terrain Cube Maps\oilslickenvA.blp || RAW3 || alpha_bits=1 | |||
|} | |} | ||
=== Conversion tools === | === Conversion tools === | ||
There exist BLP tools to convert both from and to the BLP format. They can be found in [[UI FAQ/AddOn Author Resources#Resources|UI Authors resource list]]. | There exist BLP tools to convert both from and to the BLP format. They can be found in [[UI FAQ/AddOn Author Resources#Resources|UI Authors resource list]]. | ||