(Created page with "'''RAW''' is an image format introduced with the Dark Forces Remaster. It is the format for high resolution textures. RAW textures are true colour; they do not reference the original [https://df-21.net/documentation/DFSPECS/s_palplt.htm#PAL%20Files palettes]. RAW textures will be loaded in place of a classic texture if they have the same name (eg. <code>hello.BM</code>, <code>hello.RAW</code>). They ''must'' be exactly double the dimensions of the [https://df-21.net/doc...") |
|||
Line 6: | Line 6: | ||
RAW files are headerless and uncompressed. Image width and height are obtained from the corresponding BM. | RAW files are headerless and uncompressed. Image width and height are obtained from the corresponding BM. | ||
A RAW contains nothing more than an array of pixels. The number of pixels will be <code>BM width x BM height x 4</code>. | A RAW contains nothing more than an array of pixels. The number of pixels will be <code>BM width x BM height x 4</code>. Pixels are arranged by rows (note this is different from BMs where pixels are arranged in columns). | ||
Each pixel is a 4 byte struct: | Each pixel is a 4 byte struct: | ||
Line 18: | Line 18: | ||
} | } | ||
</pre> | </pre> | ||
Each value can be between 0 and 0xFF. | |||
The way the Alpha channel is handled by the game is as follows: | |||
{| class="wikitable" | |||
|- | |||
| <code>0</code> || The pixel will be transparent on an adjoining-mid texture, otherwise it will be full-bright. | |||
|- | |||
| <code>Any value from 0x1 to 0xFE</code> || The pixel will be full-bright (fully lit in all light levels and produce bloom) | |||
|- | |||
| <code>0xFF</code> || An ordinary pixel. | |||
|} | |||
=== Multiple images === | |||
Where a RAW is replacing a multi BM (most commonly, a switch), each subsequent image simply follows immediately after the previous one. |
Revision as of 11:12, 9 March 2024
RAW is an image format introduced with the Dark Forces Remaster. It is the format for high resolution textures. RAW textures are true colour; they do not reference the original palettes.
RAW textures will be loaded in place of a classic texture if they have the same name (eg. hello.BM
, hello.RAW
). They must be exactly double the dimensions of the BM they are replacing. For example, a 64x128 BM must be replaced by a 128x256 RAW.
File format
RAW files are headerless and uncompressed. Image width and height are obtained from the corresponding BM.
A RAW contains nothing more than an array of pixels. The number of pixels will be BM width x BM height x 4
. Pixels are arranged by rows (note this is different from BMs where pixels are arranged in columns).
Each pixel is a 4 byte struct:
Pixel { Red Blue Green Alpha }
Each value can be between 0 and 0xFF.
The way the Alpha channel is handled by the game is as follows:
0 |
The pixel will be transparent on an adjoining-mid texture, otherwise it will be full-bright. |
Any value from 0x1 to 0xFE |
The pixel will be full-bright (fully lit in all light levels and produce bloom) |
0xFF |
An ordinary pixel. |
Multiple images
Where a RAW is replacing a multi BM (most commonly, a switch), each subsequent image simply follows immediately after the previous one.