Bin Mesh PLG (RW Section)

From GTAMods Wiki
Jump to navigation Jump to search
RW Stream Section
Bin Mesh PLG

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.


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]
         uint32       indices[numIndices]

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