Skip to content

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

METAPARAM version 6 header152 bytes74% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04char = SMD\0magicProven
0x44u32 = 0reservedProven
0x84u32 = 6versionProven4 in 16 Sekiro files, which share this layout
0xC4u32texture countProven
0x108u64unknown offsetUnknown
0x188u64CAParam table offsetProven
0x208u64MtdParam table offsetProven
0x284u32CAParam record countProven
0x2C4u32MtdParam countProven
0x304u32unknown 30Unknown
0x344u32constant buffer byte sizeProven
0x384u32feature flagsSourced
0x3C4u32 = 0reservedProven
0x404u32unknown 40Unknown
0x444u32 = 0reservedProven
0x484u32GXMD matching keySourced
0x4C4u32CAParam block byte sizeSourced
0x504u32unknown 50Unknown
0x544u32CAParam component countSourced
0x584u32shader IDSourced
0x5C60bytes = 0reservedProven

SoulsFormatsNEXT identifies feature bits 0x10 for CAParams, 0x100 for vertex-stage material parameter reads, and 0x10000 for tessellation. Sourced · SoulsFormatsNEXT

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

METAPARAM texture48 bytes79% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x08u64name offsetProven
0x81u8unknown 08Unknown
0x91u8slot registerProven
0xA1u8 = 0reservedProven
0xB1u8texture categorySourced
0xC4i32unknown 0CUnknownUsually -1.
0x108u64default texture path offsetProven
0x188u64UV group name offsetProven
0x204u32unknown 20UnknownZero in checked Sekiro files; sometimes hash-like in Elden Ring.
0x2412bytes = 0reservedProven
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
METAPARAM pass descriptor40 bytes100% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x08u64pass array offsetProven
0x84u32pass countProven
0xC28bytes = 0reservedProven
METAPARAM render pass24 bytes33% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04u32pass IDSourced
0x44u32 = 0reservedProven
0x84u32pixel sampler maskSourced
0xC4u32hull sampler maskSourced
0x104u32vertex sampler maskSourced
0x144u32 = 0reservedProven

Bit n of each stage mask names sampler slot n. Sourced · SoulsFormatsNEXT

METAPARAM CAParam96 bytes79% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x08u64name offsetProven
0x832bytes = 0reservedProven
0x284u32sequence indexSourced
0x2C4u32parameter IDSourced
0x304u32componentSourced
0x344f32defaultProven
0x384u32unknown 38Unknown
0x3C4u32name hashSourced
0x4032bytes = 0reservedProven
METAPARAM MtdParam80 bytes95% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x08u64name offsetProven
0x828bytes = 0reservedProven
0x244u32absolute constant word offsetProven
0x284i32sequence indexSourced
0x2C1u8value typeProven
0x2D1u8renderer-only parameter flagProven2 means not a direct shader input; otherwise 0.
0x2E1boolsRGB colour conversionProven
0x2F1boolcolour flagProven
0x304u32override keyProven
0x3420float5default valueProven
0x488bytes = 0reservedProven

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