Skip to content

Textures (.texture)

Insomniac engineTexturesApplies toSunset

A .texture is stored as two assets with the same id. The SD asset (span 0) is a wrapper, a DAT1 with one section and the standard-definition pixels after it; the optional HD stream (span 1, Built Type stream in layout.csv) holds only the extra high-resolution mips with no wrapper or DAT1. The pixels are DDS-ordered mip chains. Observed

The 52,624 named texture assets are 42,841 span-0 textures and 9,783 span-1 HD streams; ALERT reports 42,840. 28,916 of the 42,841 are levels/.../envprobes/*.texture, leaving 13,925 other textures. Observed These figures are from a recorded census of the PC build 3373500; the install is no longer available. Observed

The only section of a span-0 texture is 4EDE3593, 36 bytes (present in 42,841 of 42,841): Observed

Texture header (section 4EDE3593)36 bytesSunset72% known

Little-endian. Layout from ALERT's Sunset Overdrive branch.

ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04u32SD lengthObservedSD pixel bytes; equals the wrapper's payload length
0x44u32HD lengthObservedHD stream bytes; 0 = no stream
0x84u16[2]HD width, heightObserved
0xC4u16[2]SD width, heightObserved
0x102u16array sizeObserved1 (42,714), 4 (109), 2 (8), 8 (6), 16 (2), 32 (2)
0x121u8flagsObserved0x40 = cube map; 0x80 = sRGB (inferred)
0x131u8planesUnknown4 (28,913), 0 (10,451), 1 (1,873), 18 (1,476), 2 (128)
0x142u16DXGI formatObserved
0x162u16 = 0zeroObserved
0x184u32unknownUnknown0 except 37 assets with float-like values, e.g. 0xBF000000 = −0.5f
0x1C1u8SD mip countObserved
0x1D1u8 = 0zeroObserved
0x1E4u32unknownUnknown0x01010001 (38,217), 0x03030001 (4,478), ...
0x221u8unknownUnknown1 (42,381), 3 (459), 2 (1)
0x231u8HD mip countObserved0 (33,058), 1 (2,643), 2 (7,140)

With bytes per 4 × 4 block (8 for BC1 and BC4, 16 for BC5, BC6H and BC7) or per pixel for the uncompressed formats, and each mip halving down to a minimum of one block, the size of the chain times the array size equals the SD length for 42,592 textures and six times it (cube maps) for the other 249; the HD chain times the array size equals the HD length for 9,783 of 9,783. Observed The HD mips sit above the SD ones: HD width = SD width << HD mips (7,140 textures are 4× with two HD mips, 2,643 are 2× with one). Observed The HD stream is one raw LZ4 block that decompresses to exactly the HD length (9,615 of 9,615) or, when its size equals the HD length, is stored (168 of 168). Observed

Flag 0x40 marks the cube maps exactly: it is set on the 249 textures whose SD length is six times the chain, and on no other (234 under textures/, 9 under atmospheres/). Observed

DXGI Format Textures (span 0) Confidence
95 BC6H UF16 29,146 (28,911 are environment probes) Observed
98 BC7 UNORM 11,238 Observed
83 BC5 UNORM 1,885 Observed
80 BC4 UNORM 467 Observed
28 R8G8B8A8 UNORM 92 Observed
71 BC1 UNORM 6 Observed
49 R8G8 UNORM 5 Observed
61 R8 UNORM 1 Observed
10 R16G16B16A16 float 1 Observed

No *_SRGB DXGI code appears. Observed The sRGB bit appears to be flag 0x80: it is set on 4,326 of 4,357 _c (colour) textures, 3 of 1,847 _n, and 0 of 1,601 _g. Inferred Path suffixes (_c colour BC7 with the sRGB bit, _n normal BC5, _g gloss or mask BC7 linear) come from counts of path suffixes only. Inferred The minimap ui/textures/hud/map/minimap.texture (id 0D9CD9DA) is BC7, 4688 × 3364, 1 mip, no HD stream; its SD length 15,770,432 is 1172 × 841 × 16. Observed

What is the slice order of array textures with mips, and the cube face order?

Array textures seen have one mip, which does not discriminate slice-major (DDS) from mip-major layout. The face order of the 249 cube maps is assumed to be the DDS order (+X −X +Y −Y +Z −Z) and was not checked.

What do the planes byte and the header fields at 24, 30 and 34 mean?

All are stored and counted; none has an established meaning.

Sources

  • ALERT (Tkachov) — texture/header.py, the Sunset Overdrive branch, is the origin of the header field names