WoW:BLP file: Difference between revisions

405 bytes removed ,  10 October 2010
→‎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>alpha-depth</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.
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 raw color data. There is only one known image using this format, and had 32 bit BGRA pixels with <tt>alpha-depth</tt> set to 8. One might infer that with <tt>alpha-depth</tt> set to 0 the image would use 24 bit BGR pixels, but no such example exists.
==== 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>alpha_bits</tt> is set to 0, DXT1 compression is used.
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 for black.
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.
==== DXT1a ====
If <tt>alpha_bits</tt> is set to 1, DXT1a compression is used.
Each block is 64 bits and is identical to DXT1, except that transparent is reserved in the palette instead of black.


==== DXT3 ====
==== DXT3 ====


If <tt>alpha_bits</tt> is set to 4 or 8, and <tt>alpha_type</tt> is 0, 1, or 8, then DXT3 compression is used.
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.
==== DXT2 and DXT4 ====
DXT2 and DXT4 are identical to DXT3 and DXT5, respectively, save that pixel data winds up being premultiplied by alpha -- that is, each RGBA pixel is not represented by (r, g, b, a) but instead by (ar, ag, ab, a) where all values are normalised to lie between 0 and 1. World of Warcraft does not use these formats.


=== Sample Files ===
=== Sample Files ===
Line 92: Line 87:
| GLUES\LoadingBar\Loading-BarGlow.blp || RAW1 || No alpha
| GLUES\LoadingBar\Loading-BarGlow.blp || RAW1 || No alpha
|-
|-
| Interface\CURSOR\Attack.blp || RAW1 || 1-bit alpha
| CURSOR\Attack.blp || RAW1 || 1-bit alpha
|-
|-
| Interface\CURSOR\Buy.blp || RAW1 || 8-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, width=768
| 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]].
Anonymous user