Enhanced material parameters
A drawable’s shader group owns shader records and can embed a texture dictionary. Each shader names an effect by hash and supplies typed material parameters, a render bucket and a bucket mask. Compiled programs and their pass states live in SGD2. Proven
Every shader and its parameters in all version-159 YDR/YDD and version-171 YFT copies pass the structural resource census, with every effect, texture-parameter and buffer-parameter hash resolving. Fifteen other-version YDRs are excluded. The record and descriptor proofs on this page apply to the accepted versions. Proven · all accepted drawable resources
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 4 | u32 | effect name hash | Proven | |
| 0x4 | 4 | u32 | preset word | Proven | 0x6D657461 in the inspected shader census |
| 0x8 | 8 | pointer | parameter buffer pointers | Proven | |
| 0x10 | 8 | pointer | texture-reference pointers | Proven | |
| 0x18 | 8 | bytes | unknown | Unknown | |
| 0x20 | 8 | pointer | parameter information | Proven | |
| 0x28 | 17 | bytes | unknown | Unknown | |
| 0x39 | 1 | u8 | render bucket | Proven | |
| 0x3A | 2 | bytes | unknown | Unknown | |
| 0x3C | 4 | u32 | bucket mask | Proven |
All 721,634 shaders of the full-install census have one preset-word value, 0x6D657461; the word alone does not
distinguish material families. Effect identity, parameters and render state carry that distinction. Proven
The parameter-info header is eight bytes: buffer, texture, other, sampler and parameter counts, two zero bytes, then buffer-copy count. Eight-byte parameter records follow. Proven
| Offset | Size | Type | Field | Confidence | Notes |
|---|---|---|---|---|---|
| 0x0 | 4 | u32 | parameter name hash | Proven | |
| 0x4 | 4 | u32 | packed parameter descriptor | Proven |
| Descriptor bits | Meaning | Confidence |
|---|---|---|
| 0–1 | Kind: 0 texture, 1 other, 2 sampler, 3 constant-buffer data | Proven |
| 2–9 for reference kinds | Reference index | Proven |
| 2–7 for buffer data | Constant-buffer index | Proven |
| 8–19 for buffer data | Byte offset in buffer | Proven |
| 20–31 for buffer data | Byte length | Proven |
Buffer pointers can be stored in several copies. Texture references point at texture bases carrying names; a null texture pointer is a stored absence, not a named white texture. Proven
CodeWalker’s conversion XML maps Enhanced names to Legacy names. For example, Specular corresponds to
specularFalloffMult, and SpecularColor to specularIntensityMult. Exported Legacy names therefore do not
necessarily reproduce the original Enhanced parameter identifiers. Sourced · CodeWalker
The same XML gives each material constant’s buffer and byte offset. For normal_spec_decal, buffer 1 holds
Fresnel at 0, Specular at 4, SpecularColor at 8 and specMapIntMask at 16. Sourced · CodeWalker
An AlphaTest parameter exists in only 12 tree effects of the XML’s list. Sourced · CodeWalker The alpha reference
of other cutout materials is therefore not a material constant but part of the render state. Inferred
The program binding tables independently relate current material hashes, program identifiers and constant-buffer offsets. A material’s constants and engine-global constants have different owners even when both are shader inputs. Proven
Their presence is recorded, but decoding a reference index does not establish the resource’s runtime role. Unknown