Bin Mesh PLG (RW Section)

From GTAMods Wiki
Revision as of 10:54, 13 August 2015 by The hero (talk | contribs) (reworked the page)
Jump to navigation Jump to search
{{{NAME}}}
RenderWare Stream Section
Vendor {{{VENDORNAME}}}
Module {{{MODULENAME}}}
Module ID 0x{{{MODULEID}}}
Identifier 0x{{{IDENTIFIER}}}
Chunk ID 0x{{{MODULEID}}}{{{IDENTIFIER}}}
Versions All
Hierarchy
Parents:
None
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