I’ve recently discovered a CPU spike that occurs when other player models are in the client scene, and I’m wondering how to optimize it CPU-wise. I don’t fully know what all is done on CPU or GPU, so I’ll outline what I have and think may be going on.
Here’s a PG that shows the player model:
If you open the performance monitor in chrome, after 3 seconds the new players will spawn in and you will see a little bit of a spike in CPU usage. Nothing crazy, but if you add it in to a scene with a bunch of other things happening, it creates a bit of lag.
Here are my questions:
- What processes are heavy on the CPU for this example? I believe the animations are done on the GPU, the frustum check shouldn’t really effect it because I have it set to alwaysSelectAsActiveMesh, so that leaves me to believe it’s probably the WorldMatrix calculation?
- If I’m correct in assuming it is the WorldMatrix calculation that is most CPU heavy, how can I optimize this?
- Does it matter that the character is composed of like ~30 meshes that are all just parented to the main body mesh? Would it be more efficient CPU wise if I joined all of the meshes into 1 mesh?
Also, if you check out my playground and notice anything about that player model that could cause lag, or have any ideas on how to optimize the model, I would appreciate all of the help I can get!