Texture/PC

From Burnout Wiki

Structures

Header

Likely derived at least in part from D3DXIMAGE_INFO or a related structure such as D3DSURFACE_DESC.

Offset Length Type Name Description Comments
0x0 0x4 void* ? Points to the texture data.
Points to Renderable data if flag 0x8 is set.
Null in asset. Used in memory.
Points to the beginning of texture data.
If flag 0x8 is set, points to somewhere within Renderable data, not the start. Offset varies.
0x4 0x4 Texture interface* ? Texture interface Null in asset. Used in memory.
0x8 0x4 Padding
0xC 0x2 D3DPOOL Pool Memory class Always 1
0xE 0x1 uint8_t ? ? Set on its own in GLOBALBACKDROPS and WORLDTEX.
Additionally set together with 0xF in GLOBALPROPS, vehicle GRs and wheel GRs.
0xF 0x1 uint8_t ? ? Set on its own in GLOBALBACKDROPS, GLOBALPROPS, WORLDTEX, and some bike GRs.
Additionally set together with 0xE in vehicle GRs and wheel GRs.
0x10 0x4 D3DFORMAT Format A value from the D3DFORMAT enumerated type that most closely describes the data in the original image.
0x14 0x2 uint16_t Width Width of original image in pixels.
0x16 0x2 uint16_t Height Height of original image in pixels.
0x18 0x1 uint8_t Depth Depth of original image in pixels. As there are no 3D textures in Burnout, this is always 1.
0x19 0x1 uint8_t MipLevels Number of mip levels in original image.
0x1A 0x1 uint8_t ? Texture type See Texture type
0x1B 0x1 uint8_t ? Flags See Flags

Unions

Texture interface

Real name is unknown.

Length Type Name Description Comments
0x4 IDirect3DTexture9* ? See IDirect3DTexture9 on MS docs
0x4 IDirect3DCubeTexture9* ? See IDirect3DCubeTexture9 on MS docs
0x4 IDirect3DVolumeTexture9* ? See IDirect3DVolumeTexture9 on MS docs

Enumerations

D3DPOOL

From the Microsoft docs page.

Name Value Comments
D3DPOOL_DEFAULT 0 Resources are placed in the memory pool most appropriate for the set of usages requested for the given resource. This is usually video memory, including both local video memory and AGP memory.
D3DPOOL_MANAGED 1 Resources are copied automatically to device-accessible memory as needed.
D3DPOOL_SYSTEMMEM 2 Resources are placed in memory that is not typically accessible by the Direct3D device.
D3DPOOL_SCRATCH 3 Resources are placed in system RAM and do not need to be recreated when a device is lost.
D3DPOOL_FORCE_DWORD 0x7FFFFFFF Forces this enumeration to compile to 32 bits in size. This value is not used.

D3DFORMAT

From the Microsoft docs page.

Name Value Comments
D3DFMT_UNKNOWN 0 Surface format is unknown
D3DFMT_R8G8B8 20 24-bit RGB pixel format with 8 bits per channel.
D3DFMT_A8R8G8B8 21 32-bit ARGB pixel format with alpha, using 8 bits per channel.
D3DFMT_X8R8G8B8 22 32-bit RGB pixel format, where 8 bits are reserved for each color.
D3DFMT_R5G6B5 23 16-bit RGB pixel format with 5 bits for red, 6 bits for green, and 5 bits for blue.
D3DFMT_X1R5G5B5 24 16-bit pixel format where 5 bits are reserved for each color.
D3DFMT_A1R5G5B5 25 16-bit pixel format where 5 bits are reserved for each color and 1 bit is reserved for alpha.
D3DFMT_A4R4G4B4 26 16-bit ARGB pixel format with 4 bits for each channel.
D3DFMT_R3G3B2 27 8-bit RGB texture format using 3 bits for red, 3 bits for green, and 2 bits for blue.
D3DFMT_A8 28 8-bit alpha only.
D3DFMT_A8R3G3B2 29 16-bit ARGB texture format using 8 bits for alpha, 3 bits each for red and green, and 2 bits for blue.
D3DFMT_X4R4G4B4 30 16-bit RGB pixel format using 4 bits for each color.
D3DFMT_A2B10G10R10 31 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
D3DFMT_A8B8G8R8 32 32-bit ARGB pixel format with alpha, using 8 bits per channel.
D3DFMT_X8B8G8R8 33 32-bit RGB pixel format, where 8 bits are reserved for each color.
D3DFMT_G16R16 34 32-bit pixel format using 16 bits each for green and red.
D3DFMT_A2R10G10B10 35 32-bit pixel format using 10 bits each for red, green, and blue, and 2 bits for alpha.
D3DFMT_A16B16G16R16 36 64-bit pixel format using 16 bits for each component.
D3DFMT_A8P8 40 8-bit color indexed with 8 bits of alpha.
D3DFMT_P8 41 8-bit color indexed.
D3DFMT_L8 50 8-bit luminance only.
D3DFMT_A8L8 51 16-bit using 8 bits each for alpha and luminance.
D3DFMT_A4L4 52 8-bit using 4 bits each for alpha and luminance.
D3DFMT_V8U8 60 16-bit bump-map format using 8 bits each for u and v data.
D3DFMT_L6V5U5 61 16-bit bump-map format with luminance using 6 bits for luminance, and 5 bits each for v and u.
D3DFMT_X8L8V8U8 62 32-bit bump-map format with luminance using 8 bits for each channel.
D3DFMT_Q8W8V8U8 63 32-bit bump-map format using 8 bits for each channel.
D3DFMT_V16U16 64 32-bit bump-map format using 16 bits for each channel.
D3DFMT_A2W10V10U10 67 32-bit bump-map format using 2 bits for alpha and 10 bits each for w, v, and u.
D3DFMT_D16_LOCKABLE 70 16-bit z-buffer bit depth.
D3DFMT_D32 71 32-bit z-buffer bit depth.
D3DFMT_D15S1 73 16-bit z-buffer bit depth where 15 bits are reserved for the depth channel and 1 bit is reserved for the stencil channel.
D3DFMT_D24S8 75 32-bit z-buffer bit depth using 24 bits for the depth channel and 8 bits for the stencil channel.
D3DFMT_D24X8 77 32-bit z-buffer bit depth using 24 bits for the depth channel.
D3DFMT_D24X4S4 79 32-bit z-buffer bit depth using 24 bits for the depth channel and 4 bits for the stencil channel.
D3DFMT_D16 80 16-bit z-buffer bit depth.
D3DFMT_L16 81 16-bit luminance only.
D3DFMT_D32F_LOCKABLE 82 A lockable format where the depth value is represented as a standard IEEE floating-point number.
D3DFMT_D24FS8 83 A non-lockable format that contains 24 bits of depth (in a 24-bit floating point format - 20e4) and 8 bits of stencil.
D3DFMT_D32_LOCKABLE 84 A lockable 32-bit depth buffer. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
D3DFMT_S8_LOCKABLE 85 A lockable 8-bit stencil buffer. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
D3DFMT_VERTEXDATA 100 Describes a vertex buffer surface.
D3DFMT_INDEX16 101 16-bit index buffer bit depth.
D3DFMT_INDEX32 102 32-bit index buffer bit depth.
D3DFMT_Q16W16V16U16 110 64-bit bump-map format using 16 bits for each component.
D3DFMT_R16F 111 16-bit float format using 16 bits for the red channel.
D3DFMT_G16R16F 112 32-bit float format using 16 bits for the red channel and 16 bits for the green channel.
D3DFMT_A16B16G16R16F 113 64-bit float format using 16 bits for the each channel (alpha, blue, green, red).
D3DFMT_R32F 114 32-bit float format using 32 bits for the red channel.
D3DFMT_G32R32F 115 64-bit float format using 32 bits for the red channel and 32 bits for the green channel.
D3DFMT_A32B32G32R32F 116 128-bit float format using 32 bits for the each channel (alpha, blue, green, red).
D3DFMT_CxV8U8 117 16-bit normal compression format. The texture sampler computes the C channel from: C = sqrt(1 - U² - V²).
D3DFMT_A1 118 1-bit monochrome. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
D3DFMT_A2B10G10R10_XR_BIAS 119 2.8-biased fixed point. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
D3DFMT_BINARYBUFFER 199 Binary format indicating that the data has no inherent type. Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.
D3DFMT_DXT1 MAKEFOURCC('D', 'X', 'T', '1') DXT1 compression texture format
D3DFMT_DXT2 MAKEFOURCC('D', 'X', 'T', '2') DXT2 compression texture format
D3DFMT_DXT3 MAKEFOURCC('D', 'X', 'T', '3') DXT3 compression texture format
D3DFMT_DXT4 MAKEFOURCC('D', 'X', 'T', '4') DXT4 compression texture format
D3DFMT_DXT5 MAKEFOURCC('D', 'X', 'T', '5') DXT5 compression texture format
D3DFMT_G8R8_G8B8 MAKEFOURCC('G', 'R', 'G', 'B') A 16-bit packed RGB format analogous to YUY2 (Y0U0, Y1V0, Y2U2, and so on). It requires a pixel pair in order to properly represent the color value. The first pixel in the pair contains 8 bits of green (in the high 8 bits) and 8 bits of red (in the low 8 bits). The second pixel contains 8 bits of green (in the high 8 bits) and 8 bits of blue (in the low 8 bits). Together, the two pixels share the red and blue components, while each has a unique green component (G0R0, G1B0, G2R2, and so on). The texture sampler does not normalize the colors when looking up into a pixel shader; they remain in the range of 0.0f to 255.0f. This is true for all programmable pixel shader models. For the fixed function pixel shader, the hardware should normalize to the 0.f to 1.f range and essentially treat it as the YUY2 texture. Hardware that exposes this format must have the PixelShader1xMaxValue member of D3DCAPS9 set to a value capable of handling that range.
D3DFMT_MULTI2_ARGB8 MAKEFOURCC('M','E','T','1') MultiElement texture (not compressed)
D3DFMT_R8G8_B8G8 MAKEFOURCC('R', 'G', 'B', 'G') A 16-bit packed RGB format analogous to UYVY (U0Y0, V0Y1, U2Y2, and so on). It requires a pixel pair in order to properly represent the color value. The first pixel in the pair contains 8 bits of green (in the low 8 bits) and 8 bits of red (in the high 8 bits). The second pixel contains 8 bits of green (in the low 8 bits) and 8 bits of blue (in the high 8 bits). Together, the two pixels share the red and blue components, while each has a unique green component (R0G0, B0G1, R2G2, and so on). The texture sampler does not normalize the colors when looking up into a pixel shader; they remain in the range of 0.0f to 255.0f. This is true for all programmable pixel shader models. For the fixed function pixel shader, the hardware should normalize to the 0.f to 1.f range and essentially treat it as the YUY2 texture. Hardware that exposes this format must have PixelShader1xMaxValue member of D3DCAPS9 set to a value capable of handling that range.
D3DFMT_UYVY MAKEFOURCC('U', 'Y', 'V', 'Y') UYVY format (PC98 compliance)
D3DFMT_YUY2 MAKEFOURCC('Y', 'U', 'Y', '2') YUY2 format (PC98 compliance)
D3DFMT_FORCE_DWORD 0x7FFFFFFF

Texture type

The type/dimension of the texture. Determines the interface type pointed to at 0x4.

Name Value Comments
? 0 2D texture
? 1 1D (Cube) texture
? 2 3D (Volume) texture
? 3 Same as 2D texture

Flags

Name Value Comments
? 0x1 Always 0
? 0x2 Always 0
? 0x4 Always 0
? 0x8 Indicates the texture will be applied to a model