Difference between revisions of "War Drum OpenGL Native Data"

From GTAMods Wiki
Jump to navigation Jump to search
m (The hero moved page OpenGL Native Data to War Drum OpenGL Native Data: Page does not describe stock-RW OpenGL Native Data)
m (Redirected page to Native Data PLG (RW Section))
(Tag: New redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page describes the format of pre-instanced DFFs as used by the mobile GTA games.
+
#REDIRECT [[Native Data PLG (RW Section)]]
 
 
==Bin Mesh==
 
The [[Bin_Mesh_PLG_(RW_Section)|Bin Mesh]]'s chunk format is almost the same as in non-instanced DFFs. The only difference is that the indices are uint16 (as used internally by RW) instead of uint32.
 
 
 
==Native Data==
 
 
 
The Native Data has no child Struct like on the other platforms and not platform information.
 
 
 
uint32      number of attributes (numAttribs)
 
#repeat for numAttribs (attribute description)
 
    uint32  attribute index
 
    int32    type (0 = GL_FLOAT, 1 = GL_BYTE, 2 = GL_UNSIGNED_BYTE, 3 = GL_SHORT, 4 = GL_UNSIGNED_SHORT)
 
    bool32  isNormalized
 
    int32    size
 
    uint32  stride (same for all attributes)
 
    uint32  offset
 
#endrepeat
 
uint8        data[stride*geometry->numVertices]
 
 
 
Apart from the type, attribute descriptions can be directly passed to [https://www.khronos.org/opengles/sdk/docs/man/xhtml/glVertexAttribPointer.xml glVertexAttribPointer].
 
 
 
=== Indices ===
 
 
 
Each vertex attribute in an OpenGL shader has an index. The indices used by the mobile GTAs are the following:
 
 
 
0 - vertex position
 
1 - tex coord 0
 
2 - normal
 
3 - color
 
4 - vertex weights (only used with skinned geometry)
 
5 - bone indices (only used with skinned geometry)
 
6 - extra color (only used with SA's extra color plugin)
 
 
 
== Skin ==
 
 
 
The Skin chunk contains a Struct chunk with the following data:
 
 
 
uint32  platform ID (2 for OpenGL)
 
uint32  number of Bones (numBones)
 
float32  matrices[numBones][16]
 
 
 
== See also ==
 
* [[RenderWare|RenderWare]]
 
* [[Geometry (RW Section)|Geometry]]
 
* [[Bin Mesh PLG (RW Section)|Bin Mesh]]
 
* [[Native Data PLG (RW Section)|Native Data]]
 
* [[Skin PLG (RW Section)|Skin]]
 

Latest revision as of 07:46, 13 September 2020