Skip to content

Enhanced material parameters

RAGEMaterialsApplies toGTA V

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

Enhanced drawable shader64 bytes58% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04u32effect name hashProven
0x44u32preset wordProven0x6D657461 in the inspected shader census
0x88pointerparameter buffer pointersProven
0x108pointertexture-reference pointersProven
0x188bytesunknownUnknown
0x208pointerparameter informationProven
0x2817bytesunknownUnknown
0x391u8render bucketProven
0x3A2bytesunknownUnknown
0x3C4u32bucket maskProven

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

Material parameter info8 bytes100% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04u32parameter name hashProven
0x44u32packed parameter descriptorProven
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

What do the remaining shader-record bytes and other-reference kinds control?

Their presence is recorded, but decoding a reference index does not establish the resource’s runtime role. Unknown