Skip to content

Textures in XNB files

MonoGame / XNATexturesApplies toSTUNTBOOST

STUNTBOOST stores its images two ways, both inside XNB containers. Neither is block-compressed on disk. Observed · STUNTBOOST

The 401 Texture2DReader files (125 in Textures/UI, 103 in Models/Resources, 70 in Achievements, 53 in Controls, and the rest in World, Playtesting, HUD and Button) hold a raw uncompressed surface. After the reader’s type id the object is: the surface format (i32), width, height and level count (each i32), then per level a byte count (i32) and the pixels. Proven · STUNTBOOST

Texture2DReader objectvariableSTUNTBOOST100% known

Little-endian. After the 7-bit type id of the primary object.

ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04i32 = 0surface formatProvenSurfaceFormat.Color: 8-bit R, G, B, A; 0 in all 401 files
0x44i32widthProven
0x84i32heightProven
0xC4i32level countProven1 in all 401 files
0x10per levellevel[]levelsProvenper level an i32 byte count (width × height × 4 of that level, with each side halved per level and at least 1) and that many bytes, rows top to bottom

Each file is read to its last byte, and every level’s byte count is its pixels’ size. Proven · STUNTBOOST The sizes vary: 640 × 144 (153 files), 64 × 64 (25), 279 × 337 (14), 160 × 90 (13) and many others. Proven · STUNTBOOST

The 576 QoiReader files hold the larger images: the baked lighting atlases of the levels, the background and achievement art. The object is an i32 byte count and a QOI file of that length, which ends exactly at the end of the XNB. Proven · STUNTBOOST

A QOI file has a 14-byte header (qoif, width and height as big-endian u32, channels, colour space), a stream of chunks and an 8-byte end marker. Sourced · QOI specification All 576 have 4 channels and colour space 0 (sRGB with linear alpha). Proven · STUNTBOOST

Size Files Where Confidence
4096 × 4096 198 Models/Resources: the baked atlases of the levels Proven · STUNTBOOST
1920 × 432 154 Textures/Backgrounds and Achievements Proven · STUNTBOOST
1920 × 1080 69 backgrounds Proven · STUNTBOOST
512 × 512 60 Proven · STUNTBOOST
5160 × 2161 and 5160 × 2160 55 and 7 backgrounds Proven · STUNTBOOST
2048 × 2048, 1024 × 1024, 256 × 256, 691 × 1080, 1404 × 688, 1920 × 416 8, 3, 2, 4, 2, 1 Proven · STUNTBOOST

374 of the QOI files are in Models/Resources (the level bakes and model textures), 128 in Textures/Backgrounds, 68 in Textures/Achievements and 6 in Textures/UI. Proven · STUNTBOOST

A level’s glTF materials point at their textures through glTF samplers. The levels’ samplers state nearest magnification (9728) and nearest-mipmap-linear minification (9984), so texels are crisp. Observed · STUNTBOOST

The lighting of a level is baked into atlases, one per bake group, BakeN_Denoised, and a second BakeN_DIRECT_Denoised carried as the material’s KHR_materials_specular colour texture (baked lighting). The atlas alone looks much darker than the game draws it, because no colour grading is applied at run time and the grading is part of the bake. Observed · STUNTBOOST