Renderable/PlayStation 3

From Burnout Wiki

Structures

Renderable

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

RenderableMesh

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

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

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

renderengine::IndexBuffer

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 Index type See index type
Always PS3INDEXTYPE_16?
0x11 0x1 uint8_t m_location Memory location See location
0x12 0x1 uint8_t m_type Buffer type See IndexBuffer type
Always TYPE_STATIC?
0x13 0x1 uint8_t m_lockFlags Lock flags See IndexBuffer lock flags
Always 0?

renderengine::VertexBuffer

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_bufferSize Buffer size in bytes
0xC 0x1 uint8_t m_location Memory location See location
0xD 0x1 uint8_t m_lockFlags Lock flags See VertexBuffer lock flags
Always 0?
0xE 0x2 uint16_t m_pad0 Padding

Enumerations

Renderable flags

Name Value Comments
E_FLAG_CAST_SHADOWS? 0x1 Based on version 8 info
E_FLAG_RECEIVE_SHADOWS? 0x2 Based on version 8 info
? 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

Index type

Name Value Comments
PS3INDEXTYPE_32 0 32 depth
PS3INDEXTYPE_16 1 16 depth

Location

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

IndexBuffer type

Name Value Comments
TYPE_STATIC 0
TYPE_DYNAMIC 1

IndexBuffer lock flags

Name Value Comments
LOCK_READ 0x1
LOCK_WRITE 0x2
LOCK_NOOVERWRITE 0x8

VertexBuffer lock flags

Name Value Comments
LOCK_READ 0x1
LOCK_WRITE 0x2
LOCK_DISCARD 0x4
LOCK_NOOVERWRITE 0x8