Difference between revisions of "Texture Native Struct"

From GTAMods Wiki
Jump to navigation Jump to search
(Image Data)
(Replaced content with "{{request-delete}}")
(Tag: Replaced)
 
(58 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{RW Section|Struct|0x0001}}
+
{{request-delete}}
 
 
''This article is about the [[Struct (RW Section)|Struct]] section accompanied by a [[Texture Native (RW Section)|Texture Native]] parent section.''
 
 
 
The '''Texture Native Struct''' section can usually be found in [[texture archive]]s used by the PC and XBOX versions of the GTA III game trilogy. They are the most important sections inside a <source>.txd</source> file since they contain the names, dimensions and the actual image data for textures. The typical location in the file's section hierarchy is ''[[Texture Dictionary (RW Section)|Texture Dictionary]] > [[Texture Native (RW Section)|Texture Native]] > Struct''.
 
 
 
==Header==
 
 
 
There is a ''88 byte'' header with general image information:
 
 
 
  4b - DWORD    - Platform ID
 
  4b - DWORD    - Filter Flags
 
32b - CHAR[32] - Diffuse Texture Name (null-terminated string)
 
32b - CHAR[32] - Alpha Texture Name (null-terminated string)
 
  4b - DWORD    - Image Flags
 
  4b - DWORD    - Is alpha used? (0: no, 1: yes); Platform 9 uses DXT* codes here
 
  2b - WORD    - Image Width
 
  2b - WORD    - Image Height
 
  1b - BYTE    - Bit Depth
 
  1b - BYTE    - Mipmap Count
 
  1b - BYTE    - unknown, always 4
 
  1b - BYTE    - Compression Type
 
 
 
;Platform ID: This is 8 for GTA3 and VC on the PC, 9 for GTA SA on the PC, and 5 for GTA3/VC/SA on the XBOX.
 
;Filter Flags: ''- todo -''
 
;Image Flags: ''- todo -''
 
// 512 = 16bpp no alpha
 
// 768 = 16bpp with alpha
 
 
// 9728= 8bpp no alpha
 
// 9472= 8bpp with alpha
 
 
// 1536= 32bpp no alpha  < -+- SET IF ANY XBOX
 
// 1280= 32bpp with alpha < /
 
 
// 512? = dxt1 no alpha
 
// 768 = dxt3 with alpha
 
// ? = dxt3 no alpha
 
 
// 256 = used in generic.txd (first of 2 duplicates in img file)
 
// and in hud.txd too
 
 
// 6 = was used for body in ashdexx's sample
 
// custom xbox working txd
 
 
 
;Bit Depth: 8, 16 or 32; 8 comes with palette
 
;Compression Type: ''- todo -''
 
 
 
==Image Data==
 
 
 
The header is followed by image data.
 
 
 
''- todo (size, palette, pixels, mipmaps) -''
 
 
 
===8 bit per pixel===
 
 
 
The 8 bit textures make use of a ''color palette'', so they only support up to 256 different colors. The one byte for each pixel is an index into the palette.
 
 
 
1024 byte  - BYTE[256][4] - palette of RGBA colors
 
4 byte    - DWORD        - size of pixel data
 
w*h*1 byte - BYTE[w*h]    - pixels, 1 byte each
 
 
 
===16 bit per pixel===
 
 
 
''- todo -''
 
 
 
===32 bit per pixel===
 
 
 
4 byte    - DWORD        - size of pixel data
 
w*h*4 byte - BYTE[w*h][4] - pixels, 4 byte each (BGRA colors!)
 
 
 
===DXT compressed===
 
 
 
''- todo (mipmaps!) -''
 
 
 
 
 
{{File-stub}}
 

Latest revision as of 12:04, 11 September 2020

Delete.png This article has been requested for deletion
You may suggest different in the discussion page.