Renderable: Difference between revisions

Added initial resource type information.
m (oops)
(Added initial resource type information.)
Line 1:
{{todo|Add platforms aside from PS3. They're researched, just need to be added.}}
 
{{ParadiseResourceTypeInfobox
| name = Renderable
| othernames = RwRenderable and GtRenderable
| example = [[File:Paradise_Renderable_Example.png|frameless|200px]]<br />The Ikusa GT's engine block Renderable.
| id = 0xC
| category = Generic
| memdist = Header in Main Memory<br />Buffers in [[Bundle 2/Burnout Paradise#Memory types|secondary]]
| imports = [[Material]]<br />[[Vertex Descriptor]]
| importedby = [[Model]]
}}
 
The Renderable resource type is used for all model data in Burnout Paradise.
 
Renderable resources import [[Material|materials]] and [[Vertex Descriptor|vertex descriptors]]. They are imported by [[Model|models]].
 
= VariantsStructures =
=== Renderable ===
{{subpage|PlayStation 3|text=Information on the Renderable resource type used on PlayStation 3.}}
==== PlayStation 3, Xbox 360 ====
{| class="wikitable"
! 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|RenderableMesh]]** || mppMeshes || Meshes ||
|-
| 0x18 || 0x4 || ObjectScopeTextureInfo* || mpObjectScopeTextureInfo || || Set at runtime
|-
| 0x1C || 0x2 || uint16_t || mu16Flags || Flags || Always 0xFF?
|}
 
==== PC ====
{| class="wikitable"
! 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|RenderableMesh]]** || mppMeshes || Meshes ||
|-
| 0x18 || 0x4 || ObjectScopeTextureInfo* || mpObjectScopeTextureInfo || || Set at runtime
|-
| 0x1C || 0x2 || uint16_t || mu16Flags || Flags || Always 0xFF?
|-
| 0x1E || 0x2 || || || Padding ||
|-
| 0x20 || 0x4 || uint32_t* || ? || Number of indices ||
|-
| 0x24 || 0x4 || [[#renderengine::VertexBuffer|VertexBuffer]]* || ? || Vertices || Relative to secondary resource portion
|}
 
==== PC (Remastered) ====
{| class="wikitable"
! 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|RenderableMesh]]** || mppMeshes || Meshes ||
|-
| 0x18 || 0x4 || ObjectScopeTextureInfo* || mpObjectScopeTextureInfo || || Set at runtime
|-
| 0x1C || 0x2 || uint16_t || mu16Flags || Flags || Always 0xFF?
|-
| 0x1E || 0x2 || || || Padding ||
|-
| 0x20 || 0x4 || [[#renderengine::IndexBuffer|IndexBuffer]]* || ? || Index buffer || Relative to secondary resource portion
|-
| 0x24 || 0x4 || [[#renderengine::VertexBuffer|VertexBuffer]]* || ? || Vertex buffer || Relative to secondary resource portion
|}
 
==== PlayStation 4, Switch ====
{| class="wikitable"
! 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|RenderableMesh]]** || mppMeshes || Meshes ||
|-
| 0x20 || 0x8 || ObjectScopeTextureInfo* || mpObjectScopeTextureInfo || || Set at runtime
|-
| 0x28 || 0x2 || uint16_t || mu16Flags || Flags || Always 0xFF?
|-
| 0x2A || 0x6 || || || Padding ||
|-
| 0x30 || 0x8 || [[#renderengine::IndexBuffer|IndexBuffer]]* || ? || Index buffer || Relative to secondary resource portion
|-
| 0x38 || 0x8 || [[#renderengine::VertexBuffer|VertexBuffer]]* || ? || Vertex buffer || Relative to secondary resource portion
|}
 
=== RenderableMesh ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x10 || [[#PackedOobb|PackedOobb]] || mPackedBoundingBox || ||
|-
| 0x10 || 0xC || [[#DrawIndexedParameters|DrawIndexedParameters]] || mDrawIndexedParameters || ||
|-
| 0x1C || 0x4 || [[Material|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 || Usually index buffers, then vertex buffers, then vertex descriptors
|}
 
==== Xbox 360 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x10 || [[#PackedOobb|PackedOobb]] || mPackedBoundingBox || ||
|-
| 0x10 || 0x10 || [[#DrawIndexedParameters|DrawIndexedParameters]] || mDrawIndexedParameters || ||
|-
| 0x20 || 0x4 || [[Material|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 || Usually index buffers, then vertex buffers, then vertex descriptors
|}
 
=== PackedOobb ===
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x10 || [[VectorIntrinsic]] || mPackedBB || ||
|}
 
=== DrawIndexedParameters ===
==== PlayStation 3 ====
{| class="wikitable"
! 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 type|primitive types]]
|-
| 0x9 || 0x3 || || || Padding ||
|}
 
==== Xbox 360 ====
Probably not the same structure, needs to be researched and renamed at some point.
 
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || uint32_t || ? || Primitive type? || See [[#Primitive type|primitive types]]
|-
| 0x4 || 0x4 || ? || ? || || Unset pointer?
|-
| 0x8 || 0x4 || uint32_t || m_startIndex || Start index ||
|-
| 0xC || 0x4 || uint32_t || m_indexCount || Number of indices ||
|}
 
=== renderengine::IndexBuffer ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || void* || m_buffer || Buffer data || Relative to 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|location]]
|-
| 0x12 || 0x1 || uint8_t || m_type || || Always 0?
|-
| 0x13 || 0x1 || uint8_t || m_lockFlags || || Always 0?
|}
 
=== renderengine::VertexBuffer ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || void* || m_buffer || Buffer data || Relative to secondary resource portion<br />See [[#Vertex data|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|location]]
|-
| 0xD || 0x1 || uint8_t || m_lockFlags || || Always 0?
|-
| 0xE || 0x2 || uint16_t || m_pad0 || Padding ||
|}
 
=== Vertex data ===
A single entry in the vertex data. Entirely guesswork.
 
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0xC || [[Vector3]] || ? || ||
|-
| 0xC || 0x4 || uint32_t || ? || ||
|-
| 0x10 || 0x4 || uint32_t || ? || ||
|-
| 0x14 || 0x8 || [[Vector2]] || ? || ||
|-
| 0x1C || 0x4 || uint32_t || ? || ||
|-
| 0x20 || 0x4 || uint32_t || ? || ||
|}
 
= Enumerations =
=== Primitive type ===
Primitive macro values from CELL_GCM_METHOD_DATA_BEGIN_END in the SCE PS3 SDK.
{| class="wikitable"
! 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
|}
 
=== Location ===
{| class="wikitable"
! Name !! Value !! Comments
|-
| CELL_GCM_LOCATION_LOCAL + 1 || 1 || Local memory
|-
| CELL_GCM_LOCATION_MAIN + 1 || 2 || Main memory
|}