Hello,
Metahumans are cool and all, but when switching face LODs (and under other circumstances) it causes huge spikes in the RigLogic (~60ms on my machine). It usually only affects few faces within a frame, and in editor it is noticeable that it appears when the LODs switch (via distance or r.SkeletalMeshLodBias
, doesn’t matter).
I also tried to force the LOD to some value, which “fixed” the issue completely in a simple test environment, but I see the same spikes when playing our game, maybe due to switching from invisible to visible state due to occlusion, I don’t know. It’s much better, but still not “perfect”, and I want to know what’s going on and ideally find a solution.
Using the profiler and some thought, I traced the issue down to the RigLogic node in the PostProcess-AnimBP (default from Quixel bridge), which is visible in the profiler (Unreal Frontend) as:
- FParallelAnimationEvaluationTask
- SkeletalMeshComponent…
- PerformAnimEvaluation_WorkerThread
- SkeletalComponentAnimEvaluate_WorkerThread
- EvaluateAnimInstance_WorkerThread
- EvaluateAnimGraph_WorkerThread
- AnimNode_RigLogic_Evaluate_AnyThread
- BlendPosesInGraph_WorkerThread
- ControlRig_UpdateInput (which takes more than 60ms on my machine)
- BlendPosesInGraph_WorkerThread
- AnimNode_RigLogic_Evaluate_AnyThread
- EvaluateAnimGraph_WorkerThread
- EvaluateAnimInstance_WorkerThread
- SkeletalComponentAnimEvaluate_WorkerThread
- PerformAnimEvaluation_WorkerThread
- SkeletalMeshComponent…
The spike can also be seen using stat UnitGraph
or Unreal Insights (but there it’s only the SkeletalMeshComponent itself).
Now comes the time for questions:
- Did anyone else encounter this? (How) did you work around that issue?
Baking animations, not using LODs, …?
- I know it is possible to bake control rig animation to the skeleton directly and thus get rid of the RigLogic node completely. However, this only works for a single LOD (the one we baked the animation for, or a weird selection, read below), some other LODs look broken. Do you have some idea?
If we would bake the animation to a single LOD that would mean that we are stuck with that LOD (see below), which is not great for performance and for scalability. For example, the animation only works for LOD2, but a machine will scale it to LOD4, and the animation wouldn’t work anymore.
Funnily enough, while baking, we noticed that:
- LODs 4, 5, 6 and 7 are easy. Baked animations for LOD4 work for 5, 6 and 7, too.
- An animation baked for LOD0 works on LODs 1, 4, 5, 6 and 7, but not on LODs 2 and 3.
LODs 2 and 3 look quite funny when previewing an animation with the bones visualized.
- How do you think are Metahumans meant to be used for games?
Are we supposed to only use LOD4 onward with baked animation? Are we supposed to use RigLogic for runtime? Sure, it would work for a single-character game where the player visits a fully abandoned world with no other characters. But we’re building a game with a few people in one place.
What are your thoughts?
For reference, I tested in UE 5.2 and 5.3. The PostProcessAnimBP is untouched and there’s no need for an animation asset or animation blueprint. The spikes also don’t appear when there’s no animation “running”, i. e. you have to PIE or simulate to cause them.
Thank you all,
sirjofri