Difference between revisions of "FF7/TEX format"

From Final Fantasy Inside
< FF7
Jump to navigation Jump to search
my_wiki>Halkun
 
my_wiki>Mirex
(TEX Texture Data Format for PC by Mirex)
Line 1: Line 1:
== TEX Texture Data Format for PC by [[User:Mirix|Mirix]] ==
+
== TEX Texture Data Format for PC by [[User:Mirex|Mirex]] ==
  
 
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.
 
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.  
+
When bit depth is 16 then data are stored as packed RGB in style RGB555, which means 5 bits per color in one 2 byte entry. I'm not sure if it is used in FF7 at all, its probably used in FF8.
  
  
 
<table CELLSPACING="0" style="margin-bottom: 0px;">
 
<table CELLSPACING="0" style="margin-bottom: 0px;">
 +
<tr celspan
 
<tr>
 
<tr>
 
<th style="border: 1px solid rgb(0, 0, 0); vertical-align: middle; width: 51px; height: 26px; background-color: rgb(230, 230, 230);">
 
<th style="border: 1px solid rgb(0, 0, 0); vertical-align: middle; width: 51px; height: 26px; background-color: rgb(230, 230, 230);">
Line 14: Line 15:
 
<th style="border: 1px solid rgb(0, 0, 0); vertical-align: middle; width: 222px; height: 26px; background-color: rgb(230, 230, 230);">
 
<th style="border: 1px solid rgb(0, 0, 0); vertical-align: middle; width: 222px; height: 26px; background-color: rgb(230, 230, 230);">
 
Description </th>
 
Description </th>
 +
</tr>
 +
 +
<tr celspan>
 +
<td colspan="3" style="border-style: solid solid solid none; border-color: rgb(0, 0, 0); border-width: 1px; width: 348px; height: 25px;">
 +
<center> Header </center> </td>
 
</tr>
 
</tr>
  
Line 89: Line 95:
 
<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 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;">
 
</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>
+
Pixel data are present after the Palette data </td>
 
</tr>
 
</tr>
  

Revision as of 16:52, 24 November 2006

TEX Texture Data Format for PC by Mirex

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.

When bit depth is 16 then data are stored as packed RGB in style RGB555, which means 5 bits per color in one 2 byte entry. I'm not sure if it is used in FF7 at all, its probably used in FF8.


<tr celspan
Offset Size Description
Header
0x00 56 bytes Unknown
0x38 4 bytes (long) bit depth - can be 4, 8, 16
0x3c 4 bytes (long) Image Width
0x40 4 bytes (long) Image Height
0x44 20 bytes Unknown
0x58 4 bytes (long) Number of Palette Entries
0x5c 144 bytes Unknown
0xec Palette Entries * 4 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
Pixel data are present after the Palette data
Varies (sizex * sizey) if bit depth is 4 or 8, (sizex * sizey * 2) if bit depth is 16

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.