Shader METAPARAM
A shader bundle’s .metaparam describes texture slots, default textures, UV groups, per-pass sampler masks and
material constant locations. Version 6 starts with SMD\0 and has a 152-byte header. Proven · version-6 bundle census
In Sekiro’s 248 bundles, 232 version-6 files match the independent reader field for field across textures, passes, CAParams and MtdParams; the other 16 use version 4. This proves the comparison for version 6, not a version-4 layout. The comparison permits Sekiro colour type 12 where the reference otherwise expects 13. Proven · Sekiro · 232 version-6 files
Elden Ring’s four bundle binders contain 1,063 metaparams; every one reads and matches the independent reader
for header values, texture slots, passes and parameters. The texture word at offset 0x20, which the reference
skips, remains unknown rather than an independently verified meaning. No Elden Ring metaparam is refused.
Proven · Elden Ring · all 1063 bundles
The version-6 layouts below cover those 232 Sekiro and 1,063 Elden Ring files. Proven · version-6 bundle census
Sekiro’s other 16 metaparams are version 4: the 15 bundles named <shader>_lightmap and sfx_AMSN_cloth. Their shader
ID word (offset 88) is 0 in all 16. Each _lightmap file is byte for byte its version-6 sibling, the bundle of the same
name without the suffix, except at the version word (offset 8) and the shader ID (0 where the sibling has a non-zero ID),
so version 4 has the version-6 layout. Proven · Sekiro · all 16 version-4 files of the 248 bundles sfx_AMSN_cloth,
which has no sibling, reads with the same layout, and the 16 declare 201 textures, 80 render passes, 54 CAParams and one
MtdParam between them. Observed · Sekiro
Header
Section titled “Header”| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 4 | char = SMD\0 | magic | Proven | |
| 0x4 | 4 | u32 = 0 | reserved | Proven | |
| 0x8 | 4 | u32 = 6 | version | Proven | 4 in 16 Sekiro files, which share this layout |
| 0xC | 4 | u32 | texture count | Proven | |
| 0x10 | 8 | u64 | unknown offset | Unknown | |
| 0x18 | 8 | u64 | CAParam table offset | Proven | |
| 0x20 | 8 | u64 | MtdParam table offset | Proven | |
| 0x28 | 4 | u32 | CAParam record count | Proven | |
| 0x2C | 4 | u32 | MtdParam count | Proven | |
| 0x30 | 4 | u32 | unknown 30 | Unknown | |
| 0x34 | 4 | u32 | constant buffer byte size | Proven | |
| 0x38 | 4 | u32 | feature flags | Sourced | |
| 0x3C | 4 | u32 = 0 | reserved | Proven | |
| 0x40 | 4 | u32 | unknown 40 | Unknown | |
| 0x44 | 4 | u32 = 0 | reserved | Proven | |
| 0x48 | 4 | u32 | GXMD matching key | Sourced | |
| 0x4C | 4 | u32 | CAParam block byte size | Sourced | |
| 0x50 | 4 | u32 | unknown 50 | Unknown | |
| 0x54 | 4 | u32 | CAParam component count | Sourced | |
| 0x58 | 4 | u32 | shader ID | Sourced | |
| 0x5C | 60 | bytes = 0 | reserved | Proven |
SoulsFormatsNEXT identifies feature bits 0x10 for CAParams, 0x100 for vertex-stage material parameter reads,
and 0x10000 for tessellation. Sourced · SoulsFormatsNEXT
Textures and render passes
Section titled “Textures and render passes”Texture records start at byte 152; a 40-byte render-pass descriptor follows them and points to the pass array. All string offsets are file-relative and name NUL-terminated UTF-16 strings. Proven · version-6 bundle census
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 8 | u64 | name offset | Proven | |
| 0x8 | 1 | u8 | unknown 08 | Unknown | |
| 0x9 | 1 | u8 | slot register | Proven | |
| 0xA | 1 | u8 = 0 | reserved | Proven | |
| 0xB | 1 | u8 | texture category | Sourced | |
| 0xC | 4 | i32 | unknown 0C | Unknown | Usually -1. |
| 0x10 | 8 | u64 | default texture path offset | Proven | |
| 0x18 | 8 | u64 | UV group name offset | Proven | |
| 0x20 | 4 | u32 | unknown 20 | Unknown | Zero in checked Sekiro files; sometimes hash-like in Elden Ring. |
| 0x24 | 12 | bytes = 0 | reserved | Proven |
| Category | Role | Confidence |
|---|---|---|
| 0 | Other | Sourced · SoulsFormatsNEXT |
| 1, 3, 4 | Albedo, reflectance, normal | Sourced · SoulsFormatsNEXT |
| 6, 7, 10 | Emissive, displacement, flow | Sourced · SoulsFormatsNEXT |
| 14, 15, 16, 17 | Metallic, one-channel mask, three-channel mask, vector map | Sourced · SoulsFormatsNEXT |
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 8 | u64 | pass array offset | Proven | |
| 0x8 | 4 | u32 | pass count | Proven | |
| 0xC | 28 | bytes = 0 | reserved | Proven |
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 4 | u32 | pass ID | Sourced | |
| 0x4 | 4 | u32 = 0 | reserved | Proven | |
| 0x8 | 4 | u32 | pixel sampler mask | Sourced | |
| 0xC | 4 | u32 | hull sampler mask | Sourced | |
| 0x10 | 4 | u32 | vertex sampler mask | Sourced | |
| 0x14 | 4 | u32 = 0 | reserved | Proven |
Bit n of each stage mask names sampler slot n. Sourced · SoulsFormatsNEXT
Material parameters
Section titled “Material parameters”| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 8 | u64 | name offset | Proven | |
| 0x8 | 32 | bytes = 0 | reserved | Proven | |
| 0x28 | 4 | u32 | sequence index | Sourced | |
| 0x2C | 4 | u32 | parameter ID | Sourced | |
| 0x30 | 4 | u32 | component | Sourced | |
| 0x34 | 4 | f32 | default | Proven | |
| 0x38 | 4 | u32 | unknown 38 | Unknown | |
| 0x3C | 4 | u32 | name hash | Sourced | |
| 0x40 | 32 | bytes = 0 | reserved | Proven |
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 8 | u64 | name offset | Proven | |
| 0x8 | 28 | bytes = 0 | reserved | Proven | |
| 0x24 | 4 | u32 | absolute constant word offset | Proven | |
| 0x28 | 4 | i32 | sequence index | Sourced | |
| 0x2C | 1 | u8 | value type | Proven | |
| 0x2D | 1 | u8 | renderer-only parameter flag | Proven | 2 means not a direct shader input; otherwise 0. |
| 0x2E | 1 | bool | sRGB colour conversion | Proven | |
| 0x2F | 1 | bool | colour flag | Proven | |
| 0x30 | 4 | u32 | override key | Proven | |
| 0x34 | 20 | float5 | default value | Proven | |
| 0x48 | 8 | bytes = 0 | reserved | Proven |
MtdParam type 0 is bool; types 1–4 are float through float4. Colour is type 12 in Sekiro and 13 in Elden Ring, with RGBA and a fifth intensity component. These codes differ from MATBIN’s parameter codes. Proven · version-6 bundle census
The override key is a CRC-32 of the UTF-16LE logical parameter name, or zero when there is no override; that logical name need not equal the shader field name. Observed