MTD material definitions
MTD defines a material’s shader, description, typed parameters and texture declarations. Sekiro groups these
definitions in /mtd/allmaterialbnd.mtdbnd.dcx. Observed The binder holds 3,170 definitions under 3,169 names
(M[ARSN]_4m.mtd appears twice). Observed · Sekiro
Every definition in that binder is compared with an independent reader, including all decoded strings, parameters and textures. Parsing reaches the exact end of each file. Proven · all binder definitions
Elden Ring keeps the format. /mtd/allmaterialbnd.mtdbnd.dcx holds 2,517 definitions and
/mtd/speedtree.mtdbnd.dcx 85 more, 2,602 in the installed archives (the DLC archive pair is not installed). A
strict reader of the structure below, which refuses any unexpected marker, count or trailing byte, reads all 2,602 to
the exact end of each file. Proven · Elden Ring
Nested blocks
Section titled “Nested blocks”MTD is little-endian and uses length-prefixed Shift-JIS strings. Marker bytes following strings and blocks are followed by alignment bytes up to a four-byte boundary. Those bytes are zero in every Sekiro definition Proven · Sekiro and in every Elden Ring definition but one (see alignment padding). Proven · Elden Ring
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 4 | u32 = 0 | reserved | Proven | |
| 0x4 | 4 | u32 | declared body length | Proven | |
| 0x8 | 4 | u32 | block kind | Proven | |
| 0xC | 4 | u32 | block version | Proven | |
| 0x10 | 1 | u8 | marker | Proven | |
| 0x11 | 3 | bytes = 0 | alignment | Observed |
Some stock blocks overstate their lengths. Typed counts, nested structure and markers still describe the complete file; this discrepancy does not establish whether the game uses or ignores the declared lengths. Proven · all binder definitions A declared length is never shorter than the bytes the block’s structure spans, and is longer for at least one block in 83 of Sekiro’s 3,170 definitions and 92 of Elden Ring’s 2,602, by 4 to 388 bytes in Sekiro’s and 4 to 384 in Elden Ring’s. Proven · every definition of both installs A writer that gives each block the length it declares and each marker the alignment bytes it holds reproduces every definition of both installs byte for byte; one that gives each block the length it spans and zero alignment bytes reproduces 3,087 of Sekiro’s and 2,509 of Elden Ring’s. Proven · an independent writer over every definition of both installs
| Block kind | Version | Contents | Confidence |
|---|---|---|---|
| 0 | 3 | Outer material block | Proven |
| 1 | 2 | Header with string MTD and integer 1000 |
Proven |
| 2 | 4 | Shader and description | Proven |
| 3 | 4 | Parameter and texture collections | Proven |
| 4 | 4 | Parameter name, type and value block | Proven |
0x1000 |
1 | Boolean, one byte 0 or 1 | Proven |
0x1001 |
1 | Signed 32-bit integer values | Proven |
0x1002 |
1 | 32-bit float values | Proven |
0x2000 |
3 or 5 | Texture declaration | Proven |
Supported stored parameter types are bool, int, int2, float, float2, float3 and float4; the value block
also stores a component count. Proven Texture declarations contain a kind, UV number and shader-data index;
version 5 adds a fixed path and a counted float array. Proven
The MTD’s GXFT_SATStaticSwitch selects a pixel-program permutation; the shader path names the shader bundle
family. See shader bundles and
constant binding and tiling. Observed
Alignment padding
Section titled “Alignment padding”One definition breaks the zero rule: character\chr\c9757_crystal.mtd of Elden Ring’s allmaterialbnd binder
(1,556 bytes). 19 of its marker alignment runs hold non-zero bytes, where the other 3,170 Sekiro and 2,601 Elden Ring
definitions hold zeros in every run. Proven · all 5,772 definitions of both installs
| Offset | Alignment bytes |
|---|---|
0xc6 |
72 34 |
0xdd |
61 6c 5d |
0xe5 |
75 65 41 |
0xfd |
47 42 55 |
0x151 |
6c a3 00 |
0x1a1 |
62 44 69 |
0x1b9 |
6f 6f 6c |
0x259 |
66 a3 00 |
0x2b9 |
10 00 00 |
0x2c5 |
04 00 00 |
0x379 |
72 4d 61 |
0x39d |
10 00 00 |
0x3d9 |
5f 53 70 |
0x3e5 |
65 72 a3 |
0x441 |
61 6e 63 |
0x49a |
65 6e |
0x4a1 |
65 63 74 |
0x561 |
74 45 6e |
0x5b9 |
6f 64 41 |
Most runs are printable ASCII (72 34 is r4, 61 6c 5d is al], 6f 6f 6c is ool), a few carry the marker
byte a3 or the small words 10 and 04. They look like leftover buffer contents from the tool that wrote the
file, not data. Inferred Nothing else in the file is odd: every block’s declared length equals the bytes its
structure spans, and the shader (RecursiveCrystal.spx), description, ten parameters and four texture slots equal those
of character\Special\C[Crystal].mtd, which has clean padding. Observed · Elden Ring The two differ in the
texture declarations: this file stores version 3 (no path, no floats) where the sibling stores version 5.
Observed · Elden Ring Version 3 declarations occur in 86 Elden Ring definitions (174 declarations), 85 of which have zero
padding throughout, so the version does not explain the bytes. Proven · Elden Ring Sekiro stores no version 3
declaration: nine definitions hold 90 version 5 declarations with an empty path and no floats.
Proven · Sekiro
Structural parsing and independent values agree, but that does not settle how the runtime treats an incorrect declared length. Unknown
The one definition with non-zero padding ships in the install, but whether the game loads it, or what it does with the padding, is not established. Unknown
Blend mode and alpha reference
Section titled “Blend mode and alpha reference”Material definitions state g_BlendMode and g_AlphaRef. g_BlendMode takes the values 0, 2, 3, 4 and 5 and is
absent from two definitions of each game; the value 1 occurs in no definition: not in Sekiro’s 3,170 MTDs (0 in 2,957,
2 in 191, 3 in 1, 4 in 17, 5 in 2), nor in Elden Ring’s 20,619 MATBINs (0 in 19,433, 2 in 1,065, 3 in 10, 4 in 97,
5 in 12) or 2,602 MTDs (0 in 2,458, 2 in 113, 4 in 24, 5 in 5). Proven · every definition of both installs g_AlphaRef
is an integer pair; a first word above 0 is the alpha-test reference (over 255), 0 states none. Observed Elden Ring
MATBINs whose shader is named Edge state a positive first word in 878 of 924; Sekiro’s shader and material names contain no
Edge. Proven · every definition of both installs Definitions with blend mode 2 and a positive reference exist as well
(Sekiro 55 MTDs, Elden Ring 416 MATBINs and 62 MTDs), so the blend mode does not make the alpha test redundant.
Proven · every definition of both installs
Shader names
Section titled “Shader names”Sekiro’s 3,170 definitions name 257 distinct shader stems. 56 of them (1,077 definitions: the map shaders M[Multiple] 457,
M[Translucency] 169, M[MultipleGround] 169, M[LandScape] 54, M[Sky] 46, M[Mb2] 44, and eight C[...] definitions) follow
the bracket grammar of Elden Ring’s MATBIN shader names; 201 (2,093 definitions)
do not: Character_AMSN_[DetailBlend] (293, with _cloth 88), character_AMSN (578), Character_AMSN_SSS (115), Fur_NTC (218),
the GXFlver_* family and the test shaders. Proven · all 3,170 definitions