Difference between revisions of "Bin Mesh PLG (RW Section)"
								
								Jump to navigation
				Jump to search
				
				
		
					
								
							
		|  (reworked the page) | |||
| Line 1: | Line 1: | ||
| − | {{RW Section|Bin Mesh PLG| | + | {{RW Section | 
| − | + | | NAME = Bin Mesh PLG | |
| − | + | | VENDORNAME = Criterion Games | |
| − | + | | MODULENAME = World | |
| + | | MODULEID = 000005 | ||
| + | | IDENTIFIER = 0E | ||
| + | | PARENTS = [[Geometry (RW Section)|Geometry]] ''([[Extension (RW Section)|Extension]])'' | ||
| + | }} | ||
| − | In [[Native Data PLG (RW Section)|pre-instanced]] files, the chunk looks different according to platform. | + | 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 == | ||
| Line 28: | Line 32: | ||
| == See also == | == See also == | ||
| − | + | ||
| − | |||
| * [[Native Data PLG (RW Section)|Native Data]] | * [[Native Data PLG (RW Section)|Native Data]] | ||
| − | {{N|SA|VC}} | + | {{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.




