Difference between revisions of "Bin Mesh PLG (RW Section)"

From GTAMods Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{file-stub}}
+
{{RW Section
{{RW Section|Bin Mesh PLG|0x50E}}
+
| NAME = Bin Mesh PLG
The '''Bin Mesh PLG''' section stores face data split according to material indices. It is typically stored inside the [[Extension_(RW_Section)|extension]] of a [[Geometry (RW Section)|geometry section]].
+
| VENDORNAME = Criterion Games
 +
| MODULENAME = World
 +
| MODULEID = 000005
 +
| IDENTIFIER = 0E
 +
| PARENTS = [[Geometry (RW Section)|Geometry]] ''([[Extension (RW Section)|Extension]])''
 +
}}
 +
 
 +
The '''Bin Mesh''' plugin holds an optimized representation of the model topology. Triangles are grouped together into Meshes by their [[Material (RW Section)|Material]] and stored as triangle strips when the rpGEOMETRYTRISTRIP flag (0x1) is set in the [[Geometry (RW Section)|Geometry]], otherwise as triangle lists. In [[Native Data PLG (RW Section)|pre-instanced]] files, the chunk looks different according to platform.
  
 
== Structure ==
 
== Structure ==
 +
 +
uint32      flags (0 = tri list, 1 = tri strip)
 +
uint32      number of Meshes (numMeshes)
 +
uint32      total number of indices
 +
 +
#repeat for numMeshes
 +
    uint32  number of indices (numIndices)
 +
    uint32  material index (into the Geometry's material list)
 +
    #if pre-instanced
 +
          #if platform == OpenGL
 +
              uint16  indices[numIndices]
 +
          #endif
 +
    #else
 +
          uint32      indices[numIndices]
 +
    #endif
 +
#endrepeat
 +
 +
To decide if the file is an OpenGL file when reading, check the platform of the [[Native Data PLG (RW Section)|Native Data]] chunk.
 +
When no vertex indices are stored here, the pre-instanced geometry uses no indices or they are stored in the Native Data.
  
 
== See also ==
 
== See also ==
* [[RenderWare_binary_stream_file|RW file format specification]]
 
  
{{N|SA|VC}}
+
* [[Native Data PLG (RW Section)|Native Data]]
[[Category:GTA_3]]
+
 
 +
{{N|SA|VC|3}}

Latest revision as of 12:35, 11 September 2020

Bin Mesh PLG
RenderWare Stream Section
Vendor Criterion Games
Module World
Module ID 0x000005
Identifier 0x0E
Chunk ID 0x0000050E
Versions All
Hierarchy
Parents:
Geometry (Extension)
Children:
None
Extensions:
None
File Format

The Bin Mesh plugin holds an optimized representation of the model topology. Triangles are grouped together into Meshes by their Material and stored as triangle strips when the rpGEOMETRYTRISTRIP flag (0x1) is set in the Geometry, otherwise as triangle lists. In pre-instanced files, the chunk looks different according to platform.

Structure

uint32       flags (0 = tri list, 1 = tri strip)
uint32       number of Meshes (numMeshes)
uint32       total number of indices

#repeat for numMeshes
    uint32   number of indices (numIndices)
    uint32   material index (into the Geometry's material list)
    #if pre-instanced
         #if platform == OpenGL
             uint16   indices[numIndices]
         #endif
    #else
         uint32       indices[numIndices]
    #endif
#endrepeat

To decide if the file is an OpenGL file when reading, check the platform of the Native Data chunk. When no vertex indices are stored here, the pre-instanced geometry uses no indices or they are stored in the Native Data.

See also