Skip to content

Enhanced drawables and fragments

RAGEGeometryApplies toGTA V

A drawable combines geometry, shader references, bounding volumes and an optional skeleton. A YDR holds one drawable; a YDD holds drawables keyed by name hash; a YFT fragment holds a main drawable, additional drawables and physics data. Enhanced uses resource versions 159 for YDR/YDD and 171 for YFT. Proven

The structural census reads every copy with these versions: 84,592 YDRs, 23,108 YDDs and 61,064 YFTs, with no structural failures. Fifteen YDR copies use other layouts (12 version 154 and three version 165) and are excluded from these layout claims. Stored-field proofs below cover the accepted versions; they do not establish the excluded layouts or every runtime use of a field. Proven · version-filtered full-install census

CodeWalker reads version 154 and 159 YDR and YDD files with the Gen9 layout and version 165 with the Legacy layout, whatever the install. Sourced · CodeWalker

Four model-list pointers describe high, medium, low and very-low detail. These lists are inside an asset, separate from the world’s placement LOD hierarchy. Proven

Drawable base168 bytes76% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x016bytesresource baseSourced
0x108pointershader groupProven
0x188pointerskeletonProven
0x2012vec3bounding sphere centreProven
0x2C4f32bounding sphere radiusProven
0x3016vec4box minimumProven
0x4016vec4box maximumProven
0x5032pointer[4]LOD model listsProven
0x7016f32[4]LOD distancesProven
0x8016u32[4]render masksProven
0x908pointerjointsSourced
0x988bytesunknownUnknown
0xA08pointermodels blockSourced
Drawable model48 bytes71% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x08bytesunknownUnknown
0x88pointergeometry pointer arrayProven
0x102u16geometry countProven
0x122u16repeated geometry countProven
0x144bytesunknownUnknown
0x188pointerbounding boxesProven
0x208pointershader indices per geometryProven
0x284u32skeleton bindingProven
0x2C2u16render maskProven
0x2E2bytesunknown tailUnknown

A model with several geometries has a whole-model box followed by geometry boxes; a single geometry uses one box. Each geometry has its own vertex and index buffers and selects a shader through the model’s shader-index array. Proven

The sampled normal drawing path uses model render-mask bit 0. Models without that bit are other-pass proxies; the complete meaning of every mask bit is not established. Observed CodeWalker builds byte 1 of each LOD’s render mask as the OR of the low bytes of its models’ masks, and hides a model whose mask bit 0 is clear unless proxies are asked for; the FiveM headers say the model’s byte is tested against the upper byte of the shader’s draw-bucket mask. Sourced · CodeWalker, FiveM rage-formats-x CodeWalker draws a fragment as its main drawable, its cloth drawable and both drawables of every child of physics LOD 1. Sourced · CodeWalker

The Enhanced declaration is 320 bytes, with 52 semantic slots. Each present slot supplies a byte offset, stride and one-byte SGA buffer-format code. Format zero marks an absent slot. Vertices are interleaved in offset order. Proven

Enhanced vertex declaration320 bytes100% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x0208u32[52]byte offsets by semantic slotProven
0xD052u8[52]strides by semantic slotProven
0x10452u8[52]buffer formats by semantic slotProven
0x1388u64packed declaration wordProvenbits 2–9 repeat stride; other bit meanings are not all established
Slot range Semantics Confidence
0–3 POSITION0–POSITION3 Proven
4–7 NORMAL0–NORMAL3 Proven
8–11 TANGENT0–TANGENT3 Proven
12–15 BINORMAL0–BINORMAL3 Proven
16–19 BLENDWEIGHT0–BLENDWEIGHT3 Proven
20–23 BLENDINDICES0–BLENDINDICES3 Proven
24–27 COLOR0–COLOR3 Proven
28–51 TEXCOORD0–TEXCOORD23 Proven

Indices are 16-bit triangle lists in the inspected Enhanced layout. Proven

Geometry152 bytes25% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x024bytesunknown prefixUnknown
0x188pointervertex bufferProven
0x2024bytesunknownUnknown
0x388pointerindex bufferProven
0x4024bytesunknownUnknown
0x584u32index countProven
0x5C4u32triangle countProven
0x602u16low 16 bits of vertex countProven
0x622u16unknown constantUnknown3 in inspected layout
0x644bytesunknownUnknown
0x688pointerbone paletteProven
0x702u16vertex strideProven
0x722u16bone palette countProven
0x7436bytesremaining fieldsUnknown
Enhanced vertex buffer64 bytes34% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x08bytesunknown prefixUnknown
0x84u32vertex countProven
0xC2u16strideProven
0xE10bytesunknownUnknown
0x188pointervertex dataProven
0x2024bytesunknownUnknown
0x388pointerdeclarationProven
Enhanced index buffer64 bytes22% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x08bytesunknown prefixUnknown
0x84u32index countProven
0xC2u16index sizeProven2 in inspected layout
0xE10bytesunknownUnknown
0x188pointerindex dataProven
0x2032bytesunknown tailUnknown

The format byte shares its code space with Enhanced textures; it is not a direct DXGI enum cast. Vertex-colour roles depend on the shader. Proven

A tangent’s fourth component w is the handedness sign: the bitangent is cross(T, N) × w, and a normal map’s red channel runs along T and its green channel along that bitangent. Observed[against CodeWalker’s reading of the same vertices] Measured over the triangles of dt1_23_build2.ydr, this stored frame equals the frame derived from TEXCOORD0 with the bitangent pointing along +v on 98.5% of the surface area (2,578 of 2,616 m²); 1.1% of the area has degenerate UVs and 0.3% is mirrored. Observed · one drawable

A fragment’s extra drawable can have no shader group and inherit the main drawable’s shaders. Its first physics LOD can carry embedded collision. Proven

Enhanced fragment root304 bytes25% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x016bytesresource baseSourced
0x1016bytesunknownUnknown
0x2016vec4bounding sphereSourced
0x308pointermain drawableProven
0x388pointerextra drawable pointersProven
0x408pointerextra drawable name pointersProven
0x484u32extra drawable countProven
0x4C12bytesunknownUnknown
0x588pointerfragment nameProven
0x6072bytesunknownUnknown
0xA88pointerbone poseProven
0xB064bytesunknownUnknown
0xF08pointerphysics LOD groupProven
0xF88pointercloth drawableProven
0x10016bytesunknownUnknown
0x11016listlight listProven
0x12016bytesunknown tailUnknown

prop_gascyl_02b.yft stores NaN tangent components in 16 of its 634 high-detail vertices. A finite position stream does not establish that every auxiliary stream is finite. Observed

What do the remaining render masks and packed declaration bits mean?

Their stored locations are known; the interpretation above covers only the fields consumed by the inspected layout. Unknown CodeWalker’s Gen9 declaration and the FiveM RDR3 sgaInputLayout declare the packed word’s low 32 bits as hasSOA (bit 0), a flag (bit 1), the vertex size (bits 2–9) and the vertex count (bits 10–31). Whether the stock Enhanced files fill the count bits has not been checked against the data. Sourced · CodeWalker, FiveM rage-formats-x