Hi, so I’m on Mac OSX El Capitan using the newest version of Unreal. I have two nearly identical creation scripts set up, one for instanced static meshes, and one for standard object creation. Both are creating over 1,000 objects on screen. What’s really interesting is that the one with instanced static meshes is actually running at about half the frame rate of the one with a thousand unique objects on screen. Is there any reason for this to be the case???
Could you please post a screenshot on how you create the instances in your blueprint/ c++ code.
I’m not sure what there is to post, I’m literally just using ‘Add Instance’ on one Instanced Static Mesh Actor.
A little update, the instanced static mesh runs better with squares and simple objects, but as soon as I try to create an instanced static mesh of more complex models, spawning unique pawns begins to outperform instancing drastically.
Wow, 7 years and i am also having the same issue…
I did some testing and noticed non-instanced static meshes were giving better performance overall than with ISMs. This is probably due to how Nanite auto instances geometry, as I could confirm that tens of thousands of meshes were not increasing poly count or draw calls similar to what an ISM would do.
ISM seems to have degraded in performance with the latest engine versions. The problem appears to be collision calculation, maybe adding instances recalculates the whole ISM’s collision so continually calling AddInstance rebuilds the collision and the larger the ISM gets the more exponentially slow this is. That is what appears to be happening anyway.
When I disable collision on the ISMs it generates meshes very fast as expected. So to speed that up we can generate them with collision disabled at first, then turn collision on all at once afterwards. Still, this causes the game thread to choke and drop to zero FPS for a few seconds.
Also it seems strange because the meshes already have collision in the static asset files, so what’s it actually doing/calculating that takes so long? The collision is already in there, just bring it in!
Other testing with the procedural mesh component (PMC) we find that it has async cooking for collision which works a lot better for spawning lots of meshes with collision. Unfortunately async collision cooking is not available for regular or instanced static meshes.
It really puts a damper on trying to generate levels procedurally at runtime. A modern game engine should not struggle with this so badly, and it is indeed somewhat worrying.