Great. Looking forward to the update. I have since been converting more of my UInstancedStaticMeshComponents to URuntimeMeshComponents and the performance gain is amazing.
The only hard part is that I have to hand build the meshes by laying out vertices and triangles in code instead of being able to import a static mesh and use it with UInstancedStaticMeshComponent. I’ve looked into possibly reading the vertex and triangle information from a static mesh and then duplicating it over and over again as needed in the URuntimeMeshComponent. However it appears as though that can only be done by importing specific PhysX libraries which I’d prefer to avoid doing. Its not the end of the world as my meshes are fairly simplistic.
However there is one problem I’ve come up against that I haven’t been able to find a work around for and I’m afraid URuntimeMeshComponent may not support it. When creating a regular static mesh in 3ds for example, you can specify a MaterialId for each face of the mesh. This information is then imported into UE4 (in the FBX file). So if your static mesh uses two MaterialId’s for example, then when you view that static mesh in the UE4 editor, it has two Material Slots. You can specify a material for each slot and the static mesh will apply those materials to its faces based on the MaterialId. This works great with UInstancedStaticMeshComponent and I’ve been using it extensively to texture faces of the mesh differently. However URuntimeMeshComponent doesn’t appear to support this. The FRuntimeMeshVertexSimple struct doesn’t have any option to pass in an array of int32 MaterialId’s (i.e. one for each face). Is this a known limitation with URuntimeMeshComponent or just something that hasn’t been thought of yet?
What I find interesting is that URuntimeMeshComponent has the following function, virtual void SetMaterial(int32 ElementIndex, UMaterialInterface InMaterial)*. Note that it takes in an int32 ElementIndex, which is the index of the material slot (i.e. MaterialId) to set the material for. So the base class that URuntimeMeshComponent derives from must support this feature??? So would it be possible to pass in an array of int32 MaterialId in the FRuntimeMeshVertexSimple struct and apply it to the base mesh so it knows which material slot to use for which face??? I really hope so! :o