Anonymous

Changes

From Final Fantasy Inside

FF7/TEX format

4,357 bytes added, 13:48, 11 March 2005
no edit summary
== TEX Texture Data Format for PC by [[User:Mirix|Mirix]] ==

FF7 PC texture consists of header, an optional palette and bitmap data. Usually data are stored like palletized picture, with bitmap pixels referencing to palette. Color 0 (in palette its usually black) is usually used as transparent color.

Sometimes, (I'm not sure if it is used in ff7 at all), when bit depth is 16 data are stored as packed RGB in style RGB555, which means 5 bits per color in one 2 byte entry.


<table CELLSPACING="0" style="margin-bottom: 0px;">
<tr>
<th style="border: 1px solid rgb(0, 0, 0); vertical-align: middle; width: 51px; height: 26px; background-color: rgb(230, 230, 230);">
Offset </th>
<th style="border: 1px solid rgb(0, 0, 0); vertical-align: middle; width: 126px; height: 26px; background-color: rgb(230, 230, 230);">
Size </th>
<th style="border: 1px solid rgb(0, 0, 0); vertical-align: middle; width: 222px; height: 26px; background-color: rgb(230, 230, 230);">
Description </th>
</tr>

<tr>
<td style="border: 1px solid rgb(0, 0, 0); width: 51px; height: 25px;">
0x00 </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 126px; height: 25px;">
56 bytes </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 222px; height: 25px;">
Unknown </td>
</tr>
<tr>
<td style="border: 1px solid rgb(0, 0, 0); width: 51px; height: 25px;">
0x38 </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 126px; height: 25px;">
4 bytes (long) </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 222px; height: 25px;">
bit depth - can be 4, 8, 16 </td>
</tr>

<tr>
<td style="border: 1px solid rgb(0, 0, 0); width: 51px; height: 25px;">
0x3c </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 126px; height: 25px;">
4 bytes (long) </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 222px; height: 25px;">
Image Width </td>
</tr>

<tr>
<td style="border: 1px solid rgb(0, 0, 0); width: 51px; height: 25px;">
0x40 </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 126px; height: 25px;">
4 bytes (long) </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 222px; height: 25px;">
Image Height </td>
</tr>
<tr>
<td style="border: 1px solid rgb(0, 0, 0); width: 51px; height: 25px;">
0x44 </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 126px; height: 25px;">
20 bytes </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 222px; height: 25px;">
Unknown </td>
</tr>

<tr>
<td style="border: 1px solid rgb(0, 0, 0); width: 51px; height: 25px;">
0x58 </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 126px; height: 25px;">
4 bytes (long) </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 222px; height: 25px;">
Number of Palette Entries </td>
</tr>

<tr>
<td style="border: 1px solid rgb(0, 0, 0); width: 51px; height: 25px;">
0x5c </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 126px; height: 25px;">
144 bytes </td>
<td style="border: 1px solid rgb(0, 0, 0); width: 222px; height: 25px;">
Unknown </td>
</tr>

<tr>
<td style="border: 1px solid rgb(0, 0, 0); vertical-align: top; width: 51px; height: 96px;">
0xec </td>
<td style="border: 1px solid rgb(0, 0, 0); vertical-align: top; width: 126px; height: 96px;">
Palette Entries * 4 </td>
<td style="border: 1px solid rgb(0, 0, 0); vertical-align: top; width: 222px; height: 96px;">
Every 4 bytes from palette represent one color, BGRA -Blue Green Red Alpha, but I'm not sure about the alpha byte. I'm using only the BGR part </td>
</tr>

<tr>
<td style="border-style: solid none solid solid; border-color: rgb(0, 0, 0); border-width: 1px; vertical-align: top; width: 51px; height: 25px;">
</td><td colspan="2" style="border-style: solid solid solid none; border-color: rgb(0, 0, 0); border-width: 1px; width: 348px; height: 25px;">
After the Palette data </td>
</tr>

<tr>
<td style="border: 1px solid rgb(0, 0, 0); vertical-align: top; width: 51px; height: 140px;">
Varies </td>
<td style="border: 1px solid rgb(0, 0, 0); vertical-align: top; width: 126px; height: 140px;">
(sizex * sizey) if bit depth is 4 or 8, (sizex * sizey * 2) if bit depth is 16 </td>
<td style="border: 1px solid rgb(0, 0, 0); vertical-align: top; width: 222px; height: 140px;">
The
bitmap: If bit depth is 4 or 8, every byte of bitmap data is reference
to palette color. If bit depth is 16, bitmap is composed from 16bit
(2byte, short) values, which are RGB555 colors. </td>
</tr>
</table>
Anonymous user