Difference between revisions of "Textures"

From owdev
Jump to: navigation, search
(Formats)
Line 20: Line 20:
 
=== Formats ===
 
=== Formats ===
  
TODO
+
generally [https://msdn.microsoft.com/en-us/library/windows/desktop/bb173059%28v=vs.85%29.aspx dxgi_format enum]
  
 
== Type 04D ==
 
== Type 04D ==

Revision as of 20:42, 28 May 2016

Textures are stored as type 004.

Most of them though have only a 32-byte header here. The actual texture then is stored as type 04D.

Type 004

 struct texture_header {
   uint8  unk1;        // ?
   uint16 pallete_sz;  // ?
   uint8  format;      // see below
   uint16 unk2;        // padding?
   uint16 mips;        // ?
   uint16 width;       //
   uint16 height;      //
   uint32 data_sz;     // only if data is in this file, if it's zero there's an accompanying 04D file.
   uint64 ref1;        // Key?
   uint64 unk3;        // padding?
 }

Formats

generally dxgi_format enum

Type 04D

 struct raw_texture_header {
   uint32 ref1;      // maybe width? when without 004 file?
   uint32 ref2;      // maybe height? when without 004 file?
   uint32 image_sz;  // size of image blob
   uint32 bit_depth; // might be uint8 + uint8 + uint16
 }

Deshuffling

TODO