Renderable: Difference between revisions

From Burnout Wiki
Content added Content deleted
(Add information for other platforms. Thanks to Matty for much of the PC and Remastered info.)
(Add info on packed OOBB.)
Line 190: Line 190:


=== PackedOobb ===
=== PackedOobb ===
A packed oriented bounding box. It unpacks into a [[Matrix44]] through a set of vector operations.

{| class="wikitable"
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
! Offset !! Length !! Type !! Name !! Description !! Comments

Revision as of 17:45, 19 September 2023

Renderable
aka RwRenderable and GtRenderable

The Ikusa GT's engine block Renderable.
Resource names Unknown
Type ID 0xC
Category Generic
Memory
distribution
Header in Main Memory
Buffers in secondary
Imports 1 Material per mesh
Vertex Descriptor
Imported by Model
Editor
available?
No

The Renderable resource type is used for all model data in Burnout Paradise; that is, Renderables contain the data used by each Model resource.

Each Renderable contains one or more meshes, each of which is made up of an index buffer, a vertex buffer, and a set of vertex descriptors.

Structures

Renderable

PlayStation 3, Xbox 360

Offset Length Type Name Description Comments
0x0 0x10 Vector3Plus mBoundingSphere
0x10 0x2 uint16_t mu16VersionNumber Version 11
0x12 0x2 uint16_t mu16NumMeshes Number of meshes
0x14 0x4 RenderableMesh** mppMeshes Meshes
0x18 0x4 ObjectScopeTextureInfo* mpObjectScopeTextureInfo Set at runtime
0x1C 0x2 uint16_t mu16Flags Flags See flags

PC, PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x10 Vector3Plus mBoundingSphere
0x10 0x2 uint16_t mu16VersionNumber Version 11
0x12 0x2 uint16_t mu16NumMeshes Number of meshes
0x14 0x4 RenderableMesh** mppMeshes Meshes
0x18 0x4 ObjectScopeTextureInfo* mpObjectScopeTextureInfo Unused
0x1C 0x2 uint16_t mu16Flags Flags See flags
0x1E 0x2 Padding
0x20 0x4 IndexBuffer* ? Index buffer
0x24 0x4 VertexBuffer* ? Vertex buffer

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x10 Vector3Plus mBoundingSphere
0x10 0x2 uint16_t mu16VersionNumber Version 11
0x12 0x2 uint16_t mu16NumMeshes Number of meshes
0x14 0x4 Padding
0x18 0x8 RenderableMesh** mppMeshes Meshes
0x20 0x8 ObjectScopeTextureInfo* mpObjectScopeTextureInfo Unused
0x28 0x2 uint16_t mu16Flags Flags See flags
0x2A 0x6 Padding
0x30 0x8 IndexBuffer* ? Index buffer
0x38 0x8 VertexBuffer* ? Vertex buffer

RenderableMesh

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x10 PackedOobb mPackedBoundingBox
0x10 0xC DrawIndexedParameters mDrawIndexedParameters
0x1C 0x4 MaterialAssembly* mpMaterialAssembly
0x20 0x1 uint8_t mu8NumVertexDescriptors Number of vertex descriptors
0x21 0x1 uint8_t mu8InstanceCount
0x22 0x1 uint8_t mu8NumVertexBuffers Number of vertex buffers
0x23 0x1 uint8_t mu8Flags Flags Always 0?
0x24 0x4 void*[1] maBuffers Buffers Index buffers, then vertex buffers, then vertex descriptors.
See IndexBuffer and VertexBuffer

Xbox 360

Offset Length Type Name Description Comments
0x0 0x10 PackedOobb mPackedBoundingBox
0x10 0x10 DrawIndexedParameters mDrawIndexedParameters
0x20 0x4 MaterialAssembly* mpMaterialAssembly
0x24 0x1 uint8_t mu8NumVertexDescriptors Number of vertex descriptors
0x25 0x1 uint8_t mu8InstanceCount
0x26 0x1 uint8_t mu8NumVertexBuffers Number of vertex buffers
0x27 0x1 uint8_t mu8Flags Flags Always 0?
0x28 0x4 void*[1] maBuffers Buffers Index buffers, then vertex buffers, then vertex descriptors.
See IndexBuffer and VertexBuffer

PC

Offset Length Type Name Description Comments
0x0 0x40 Matrix44Affine ? Bounding box
0x40 0x18 DrawIndexedParameters mDrawIndexedParameters
0x58 0x4 MaterialAssembly* mpMaterialAssembly
0x5C 0x1 uint8_t mu8NumVertexDescriptors Number of vertex descriptors
0x5D 0x1 uint8_t mu8InstanceCount
0x5E 0x1 uint8_t mu8NumVertexBuffers Number of vertex buffers
0x5F 0x1 uint8_t mu8Flags Flags Always 0?
0x60 0x4 void*[1] maBuffers Buffers Index buffers, then vertex buffers, then vertex descriptors.
See IndexBuffer and VertexBuffer

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x40 Matrix44Affine ? Bounding box
0x40 0x10 DrawIndexedParameters mDrawIndexedParameters
0x50 0x4 MaterialAssembly* mpMaterialAssembly
0x54 0x1 uint8_t mu8NumVertexDescriptors Number of vertex descriptors
0x55 0x1 uint8_t mu8InstanceCount
0x56 0x1 uint8_t mu8NumVertexBuffers Number of vertex buffers
0x57 0x1 uint8_t mu8Flags Flags Always 0?
0x58 0x4 void*[1] maBuffers Buffers Index buffers, then vertex buffers, then vertex descriptors.
See IndexBuffer and VertexBuffer

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x40 Matrix44Affine ? Bounding box
0x40 0x10 DrawIndexedParameters mDrawIndexedParameters
0x50 0x8 MaterialAssembly* mpMaterialAssembly
0x58 0x1 uint8_t mu8NumVertexDescriptors Number of vertex descriptors
0x59 0x1 uint8_t mu8InstanceCount
0x5A 0x1 uint8_t mu8NumVertexBuffers Number of vertex buffers
0x5B 0x1 uint8_t mu8Flags Flags Always 0?
0x5C 0x4 Padding
0x60 0x8 void*[1] maBuffers Buffers Index buffers, then vertex buffers, then vertex descriptors.
See IndexBuffer and VertexBuffer

PackedOobb

A packed oriented bounding box. It unpacks into a Matrix44 through a set of vector operations.

Offset Length Type Name Description Comments
0x0 0x10 VectorIntrinsic mPackedBB

DrawIndexedParameters

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x4 uint32_t m_startIndex Start index
0x4 0x4 uint32_t m_indexCount Number of indices
0x8 0x1 uint8_t m_primitiveType Primitive type See primitive types
0x9 0x3 Padding

Xbox 360

Offset Length Type Name Description Comments
0x0 0x4 uint32_t ? Primitive type? See primitive types
0x4 0x4 int32_t ? Base vertex index
0x8 0x4 uint32_t ? Start index
0xC 0x4 uint32_t ? Number of indices

PC

Offset Length Type Name Description Comments
0x0 0x4 D3DPRIMITIVETYPE ? Primitive type
0x4 0x4 int32_t ? Base vertex index
0x8 0x4 uint32_t ? Start index
0xC 0x4 uint32_t ? Number of indices
0x10 0x4 uint32_t ? Minimum index
0x14 0x4 uint32_t ? Number of primitives

Remastered

Offset Length Type Name Description Comments
0x0 0x4 D3D11_PRIMITIVE_TOPOLOGY ? Primitive topology
0x4 0x4 int32_t ? Base vertex index
0x8 0x4 uint32_t ? Start index
0xC 0x4 uint32_t ? Number of indices

renderengine::IndexBuffer

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x4 void* m_buffer Buffer data In secondary resource portion
0x4 0x4 uint32_t m_offset Offset relative to data start
0x8 0x4 uint32_t m_numIndices Number of indices
0xC 0x4 uint32_t m_stride Size of each index value 2 or 4
0x10 0x1 uint8_t m_indexType Always 1?
0x11 0x1 uint8_t m_location Memory location See location
0x12 0x1 uint8_t m_type Always 0?
0x13 0x1 uint8_t m_lockFlags Always 0?

Xbox 360

Hmmm...
Hmmm...
To do:
Largely unknown; requires further research. Some fields may be incorrect.
Offset Length Type Name Description Comments
0x0 0x4 uint32_t ? D3D resource type May have highest nibble as a flag
See D3DRESOURCETYPE
0x4 0x4 uint32_t ? Always 1?
0x8 0x4 ? ?
0xC 0x4 ? ?
0x10 0x4 ? ?
0x14 0x2 int16_t ? Always -1?
0x16 0x2 Padding
0x18 0x4 uint32_t ? Start offset
0x1C 0x4 uint32_t ? Buffer size May have highest nibble as a flag
0x20 0x4 uint32_t ? Index count

PC

Offset Length Type Name Description Comments
0x0 0x4 uint32_t ? Number of indices
0x4 0x4 ? ? Indices
0x8 0x4 ? ? Null in samples
0xC 0x4 uint32_t ? Flags?

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x14 Buffer ? Buffer info
0x4 0x4 uint32_t ? Index size 2 or 4 bytes

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x1C Buffer ? Buffer info
0x4 0x4 uint32_t ? Index size 2 or 4 bytes

renderengine::VertexBuffer

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x4 void* m_buffer Buffer data In secondary resource portion
See vertex data
0x4 0x4 uint32_t m_offset Offset relative to data start
0x8 0x4 uint32_t m_bufferSize Buffer size in bytes
0xC 0x1 uint8_t m_location Memory location See location
0xD 0x1 uint8_t m_lockFlags Always 0?
0xE 0x2 uint16_t m_pad0 Padding

Xbox 360

Hmmm...
Hmmm...
To do:
Largely unknown; requires further research. Some fields may be incorrect.
Offset Length Type Name Description Comments
0x0 0x4 uint32_t ? D3D resource type May have highest nibble as a flag
See D3DRESOURCETYPE
0x4 0x4 uint32_t ? Always 1?
0x8 0x4 ? ?
0xC 0x4 ? ?
0x10 0x4 ? ?
0x14 0x2 int16_t ? Always -1?
0x16 0x2 Padding
0x18 0x4 uint32_t ? Start offset + 3
0x1C 0x4 uint32_t ? Buffer size + 2 May have highest nibble as a flag
0x20 0x4 uint32_t ? Buffer size

PC

Offset Length Type Name Description Comments
0x0 0x4 uint32_t ? Vertices offset In secondary resource portion
0x4 0x4 ? ? Null in samples
0x8 0x4 uint32_t ? Buffer length
0xC 0x4 Padding

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x14 Buffer ? Buffer info
0x4 0x4 ? ?
0x4 0x4 ? ?

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x1C Buffer ? Buffer info
0x4 0x4 ? ?
0x4 0x4 ? ?

Buffer

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x4 ID3D11Buffer* ? Buffer Interface Set at runtime
See the Microsoft Learn page
0x4 0x4 D3D11_USAGE ? Usage Always D3D11_USAGE_IMMUTABLE
0x8 0x4 int32_t ? Type See buffer type
0xC 0x4 void* ? Data offset
0x10 0x4 uint32_t ? Data size

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x8 ID3D11Buffer* ? Buffer Interface Set at runtime
See the Microsoft Learn page
0x8 0x4 D3D11_USAGE ? Usage hardcoded to D3D11_USAGE_IMMUTABLE
0xC 0x4 int32_t ? Type See buffer type
0x10 0x8 void* ? Data offset
0x18 0x4 uint32_t ? Data size

Vertex data

Hmmm...
Hmmm...
To do:
PS3/X360 vertex data is strange. 3 floats, then unknown data of varying length. On PC, it's all floats.

Enumerations

Renderable flags

Name Value Comments
? 0x1
? 0x2
? 0x4
? 0x8
? 0x10
? 0x20
? 0x40
? 0x80
? 0x100
? 0x200
? 0x400
? 0x800

Primitive type

Primitive macro values from CELL_GCM_METHOD_DATA_BEGIN_END in the SCE PS3 SDK.

Name Value Comments
- 0 Indicates the end of a primitive
CELL_GCM_PRIMITIVE_POINTS 1 Starts a POINTS primitive
CELL_GCM_PRIMITIVE_LINE_STRIP 2 Starts a LINE_STRIP primitive
CELL_GCM_PRIMITIVE_LINE_LOOP 3 Starts a LINE_LOOP primitive
CELL_GCM_PRIMITIVE_LINES 4 Starts a LINES primitive
CELL_GCM_PRIMITIVE_TRIANGLES 5 Starts a TRIANGLES primitive
CELL_GCM_PRIMITIVE_TRIANGLE_STRIP 6 Starts a TRIANGLE_STRIP primitive
CELL_GCM_PRIMITIVE_TRIANGLE_FAN 7 Starts a TRIANGLE_FAN primitive
CELL_GCM_PRIMITIVE_QUADS 8 Starts a QUADS primitive
CELL_GCM_PRIMITIVE_QUAD_STRIP 9 Starts a QUAD_STRIP primitive
CELL_GCM_PRIMITIVE_POLYGON 10 Starts a POLYGON primitive

D3DPRIMITIVETYPE

From the Microsoft Learn page.

Name Value Comments
D3DPT_POINTLIST 1 Renders the vertices as a collection of isolated points. This value is unsupported for indexed primitives.
D3DPT_LINELIST 2 Renders the vertices as a list of isolated straight line segments.
D3DPT_LINESTRIP 3 Renders the vertices as a single polyline.
D3DPT_TRIANGLELIST 4 Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.
Back-face culling is affected by the current winding-order render state.
D3DPT_TRIANGLESTRIP 5 Renders the vertices as a triangle strip. The backface-culling flag is automatically flipped on even-numbered triangles.
D3DPT_TRIANGLEFAN 6 Renders the vertices as a triangle fan.
D3DPT_FORCE_DWORD 0x7FFFFFFF Forces this enumeration to compile to 32 bits in size. Without this value, some compilers would allow this enumeration to compile to a size other than 32 bits. This value is not used.

D3D11_PRIMITIVE_TOPOLOGY

From the Microsoft Learn page.

Name Value Comments
D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED 0 The IA stage has not been initialized with a primitive topology. The IA stage will not function properly unless a primitive topology is defined.
D3D11_PRIMITIVE_TOPOLOGY_POINTLIST 1 Interpret the vertex data as a list of points.
D3D11_PRIMITIVE_TOPOLOGY_LINELIST 2 Interpret the vertex data as a list of lines.
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP 3 Interpret the vertex data as a line strip.
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST 4 Interpret the vertex data as a list of triangles.
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP 5 Interpret the vertex data as a triangle strip.
D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ 10 Interpret the vertex data as list of lines with adjacency data.
D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ 11 Interpret the vertex data as line strip with adjacency data.
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ 12 Interpret the vertex data as list of triangles with adjacency data.
D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ 13 Interpret the vertex data as triangle strip with adjacency data.
D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST 33 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST 34 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST 35 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST 36 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST 37 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST 38 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST 39 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST 40 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST 41 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST 42 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST 43 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST 44 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST 45 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST 46 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST 47 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST 48 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST 49 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST 50 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST 51 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST 52 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST 53 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST 54 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST 55 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST 56 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST 57 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST 58 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST 59 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST 60 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST 61 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST 62 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST 63 Interpret the vertex data as a patch list.
D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST 64 Interpret the vertex data as a patch list.

Location

Name Value Comments
CELL_GCM_LOCATION_LOCAL + 1 1 Local memory
CELL_GCM_LOCATION_MAIN + 1 2 Main memory

D3DRESOURCETYPE

From the Microsoft Xbox 360 SDK.

Name Value Comments
D3DRTYPE_NONE 0 No resource is specified.
D3DRTYPE_VERTEXBUFFER 1 Vertex buffer resource.
D3DRTYPE_INDEXBUFFER 2 Index buffer resource.
D3DRTYPE_TEXTURE 3 Texture resource.
D3DRTYPE_SURFACE 4 Surface resource.
D3DRTYPE_VERTEXDECLARATION 5 Vertex declaration resource.
D3DRTYPE_VERTEXSHADER 6 Vertex shader resource.
D3DRTYPE_PIXELSHADER 7 Pixel shader resource.
D3DRTYPE_CONSTANTBUFFER 8 Constant buffer resource.
D3DRTYPE_COMMANDBUFFER 9 Command buffer resource.
D3DRTYPE_ASYNCCOMMANDBUFFERCALL 10 Aysnchronous command buffer call resource.
D3DRTYPE_PERFCOUNTERBATCH 11 Performance counter batch resource.
D3DRTYPE_OCCLUSIONQUERYBATCH 12 Occlusion query batch resource.
D3DRTYPE_VOLUME 16 Volume resource.
D3DRTYPE_VOLUMETEXTURE 17 Volume texture resource.
D3DRTYPE_CUBETEXTURE 18 Cube texture resource.
D3DRTYPE_ARRAYTEXTURE 19 Array texture resource.
D3DRTYPE_LINETEXTURE 20 Line texture resource.
D3DRTYPE_FORCE_DWORD 0x7FFFFFFF Forces this enumeration to compile to 32 bits in size. This value is not used.

D3D11_USAGE

From the Microsoft Learn page.

Name Value Comments
D3D11_USAGE_DEFAULT 0 A resource that requires read and write access by the GPU. This is likely to be the most common usage choice.
D3D11_USAGE_IMMUTABLE 1 A resource that can only be read by the GPU. It cannot be written by the GPU, and cannot be accessed at all by the CPU. This type of resource must be initialized when it is created, since it cannot be changed after creation.
D3D11_USAGE_DYNAMIC 2 A resource that is accessible by both the GPU (read only) and the CPU (write only). A dynamic resource is a good choice for a resource that will be updated by the CPU at least once per frame. To update a dynamic resource, use a Map method.
D3D11_USAGE_STAGING 3 A resource that supports data transfer (copy) from the GPU to the CPU.

Buffer type

Name Value Comments
? 2 Vertex buffer
? 3 Index buffer
? 4 Constant buffer