Difference between revisions of "Skin PLG (RW Section)"

From GTAMods Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
{{Stub}}
 
{{Stub}}
{{RW Section|Skin PLG|0x0116}}
+
 
 +
{{cleanup-rewrite}}
 +
 
 +
{{RW Section
 +
| NAME = Skin PLG
 +
| VENDORNAME = Criterion Games
 +
| MODULENAME = Toolkit
 +
| MODULEID = 000001
 +
| IDENTIFIER = 16
 +
| PARENTS = [[Geometry (RW Section)|Geometry]] ''([[Extension (RW Section)|Extension]])''
 +
}}
 +
 
 
Skin is an additional RenderWare plugin for [[Geometry (RW Section)|geometry]] section. It is used to hold information about skinned model.
 
Skin is an additional RenderWare plugin for [[Geometry (RW Section)|geometry]] section. It is used to hold information about skinned model.
 +
 
==Structure==
 
==Structure==
 +
 
  UINT8  numBones (numMatrices)
 
  UINT8  numBones (numMatrices)
 
  UINT8  numUsedBones
 
  UINT8  numUsedBones
Line 25: Line 38:
 
  UINT16  meshBoneRLE[numRLE]
 
  UINT16  meshBoneRLE[numRLE]
 
  #endif
 
  #endif
 +
 
;numBones (numMatrices)
 
;numBones (numMatrices)
 
:Number of bones attached to the skin, also the number of inverse matrices (see '''skinToBoneMatrices''').
 
:Number of bones attached to the skin, also the number of inverse matrices (see '''skinToBoneMatrices''').
Line 57: Line 71:
  
 
;meshBoneRLE
 
;meshBoneRLE
 +
 +
{{N|SA|VC|3}}

Revision as of 12:21, 11 September 2020

40px-Ambox rewrite orange.svg.png This article may need to be rewritten.
Please help improve this article. The discussion page may contain suggestions.
Skin PLG
RenderWare Stream Section
Vendor Criterion Games
Module Toolkit
Module ID 0x000001
Identifier 0x16
Chunk ID 0x00000116
Versions All
Hierarchy
Parents:
Geometry (Extension)
Children:
None
Extensions:
None
File Format

Skin is an additional RenderWare plugin for geometry section. It is used to hold information about skinned model.

Structure

UINT8   numBones (numMatrices)
UINT8   numUsedBones
UINT8   maxWeightsPerVertex
UINT8   padding (unused)
UINT8   bonesUsed[numUsedBones]
UINT8   vertexBoneIndices[geometry->numVertices][4]
FLOAT   vertexBoneWeights[geometry->numVertices][4]
#repeat for numMatrices
    #if RwVer < 3.7.0.0 && maxWeightsPerVertex == 0
    INT32   unused 4b value, possibly a leftover from old RW versions (0xDEADDEAD)
    #endif
    FLOAT   skinToBoneMatrix[4][4]
#endrepeat
// Split data
UINT32  boneLimit
UINT32  numMeshes
UINT32  numRLE 
#if numMeshes > 0
UINT8   meshBoneRemapIndices[numBones]
UINT16  meshBoneRLECount[numMeshes]
UINT16  meshBoneRLE[numRLE]
#endif
numBones (numMatrices)
Number of bones attached to the skin, also the number of inverse matrices (see skinToBoneMatrices).
numUsedBones
Number of bones which influence vertices, that is those bones which have at least a non-zero weight. If this value is zero, RW will try to find "used" bones automatically.
maxWeightsPerVertex
Overall number of maximum non-zero weights per vertex. If zero, RW will find this value automatically.
bonesUsed
Indices list of the significant bones connected to the skin (see numUsedBones).
vertexBoneIndices
Vertex bone indices are represented with 4 bone indices per each vertex.
vertexBoneWeights
Vertex bone weights are represented with RwMatrixWeights structure per each vertex. RW docs says it's necessary to keep the order within 4 weight values (from higher to lower), but even some example models have different ordering.
skinToBoneMatrices
These are inverse matrices represented with RwMatrix structure.
boneLimit
numMeshes
numRLE
meshBoneRemapIndices
meshBoneRLECount
meshBoneRLE