Renderable: Difference between revisions

7,750 bytes removed ,  1 month ago
More versions
(Added initial resource type information.)
(More versions)
 
(8 intermediate revisions by 2 users not shown)
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_ExampleParadise 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 = 1 [[Material]] per mesh<br />[[Vertex Descriptor]]
| importedby = [[Model]]
| editor = Viewer only<br />Use [[Modding/Burnout Paradise|Noesis]]
}}
 
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 resourcescontains importone [[Material|materials]]or more meshes, each of which is made up of an index buffer, a vertex buffer, and a set of [[Vertex Descriptor|vertex descriptors]]. TheyThe arevertex importeddescriptors bydefine [[Model|models]]the data in the vertex buffers.
 
Renderables went through 11 revisions in development.
= Structures =
=== Renderable ===
==== 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"
! Version !! Retirement date
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 1 || 2006-09-13
| 0x0 || 0x10 || [[Vector3Plus]] || mBoundingSphere || ||
|-
| 2 || 2006-10-24
| 0x10 || 0x2 || uint16_t || mu16VersionNumber || Version || 11
|-
| 3 || 2006-11-09
| 0x12 || 0x2 || uint16_t || mu16NumMeshes || Number of meshes ||
|-
| 4 || 2006-12-07
| 0x14 || 0x4 || [[#RenderableMesh|RenderableMesh]]** || mppMeshes || Meshes ||
|-
| 5 || 2007-01-19
| 0x18 || 0x4 || ObjectScopeTextureInfo* || mpObjectScopeTextureInfo || || Set at runtime
|-
| 6 || 2007-02-01
| 0x1C || 0x2 || uint16_t || mu16Flags || Flags || Always 0xFF?
|-
| 7 || 2007-02-05
| 0x1E || 0x2 || || || Padding ||
|-
| 8 || 2007-03-14
| 0x20 || 0x4 || uint32_t* || ? || Number of indices ||
|-
| 9 || 2007-04-12
| 0x24 || 0x4 || [[#renderengine::VertexBuffer|VertexBuffer]]* || ? || Vertices || Relative to secondary resource portion
|}
 
==== PC (Remastered) ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 10 || 2007-05-15
| 0x0 || 0x10 || [[Vector3Plus]] || mBoundingSphere || ||
|-
| 11 || 2009-01-08. Current version
| 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
|}
 
= Variants =
==== PlayStation 4, Switch ====
{{subpage|PlayStation 3|text=Information on the Renderable resource type used on PlayStation 3.}}
{| class="wikitable"
{{subpage|Xbox 360|text=Information on the Renderable resource type used on Xbox 360.}}
! Offset !! Length !! Type !! Name !! Description !! Comments
{{subpage|PC|text=Information on the Renderable resource type used on PC.}}
|-
{{subpage|Remastered|text=Information on the Renderable resource type used in Burnout Paradise Remastered.}}
| 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
|}