- Home /
Performance impact of blend shapes
I am currently looking into the performance impact of blend shapes compared to bone animations for a factial rig. We are targeting to get at least 40 to possibly 100 characters each showing facial expressions in the screen. We are targeting the Oculus platform. A character typically has between 15k to 25k vertices and 20-30k triangles. There are roughly 25 bones driving the face and a character has around 100 bones.
I have a few test meshes with several setups. With bone based animations for facial expressions (Humanoid mecanim setup) the fact the bones are there has a slight constant performance impact over the mesh that has the bones removed. But triggering a single blend shape has a huge performance impact. (100% gpu time increase per character) Triggering a bone based animation in our setup has no considerable performance impact.
I then reduced the amount of vertices in the mesh that has the blend shape (to around 7k instead of 26k) by splitting the mesh in two and this reduced the fixed overhead for the first blend shape to 50% gpu time. However since an extra draw call per character is introduced this is not prefered - also a performance impact of 50% extra gpu time per character is not acceptable to us.
I've tested in a synthetic environment without v-sync or oculus on target hardware (gtx1080). I am rendering 1920*1080 in forward rendering on directX 11, linear color space, msaa4x, gpu skinning, but no graphics jobs. (GJs make debugging harder and have only a slight benefit in our case)
What worries me is that I am the only one that has these kind of results whereas the consensus of the internet seems to be that blend shapes are cheap and should only cost a slight increase in gpu memory which we still have plenty. I did some tests with gpu skinning disabled, but while the overhead introduced by enabling blend shapes is reduced, the performance in general is much worse.
Can someone help me better understand what is going on? here's my findings:
1. Adding bones to a rig has a slight performance impact
2. Displaying a single blend shape when using gpu skinning has a huge performance impact for that mesh
3. Displaying each subsequent blend shape (at least up to 100 additional blend shapes) have a super slight performance impact.
4. This is probably caused by some overhead required by the vertex shader communicating with the vertex buffer which is only required if there is at least one blend shape active.
5. The amount of inactive blend shapes on a character has no noticable influence
This leads me concluding that at least in the environment and hardware that we are running blend shapes are a very expensive solution to get facial animation. All performance tests I can find on the internet - albeit slightly aged - seem to suggest there is something wrong with my test data.
Either my test is wrong or there is something going on between gpu skinning and the newer versions of unity.
Probably making LODs is the way to reduce the amount of both vertices and draw calls.
Hi @fjham$$anonymous$$g_CleVR
Did you ever get to the bottom of this?
We are currently trying to decide between blend shapes and a rig for facial animation so any info you can provide would be really helpful.
Thanks!
Hi NialSoe,
I guess it really depends on both the amount of bones as well as the amount of vertices in your mesh. Note that the amount of bones also has a linear impact on the performance of the character and this is always, also when no blend shapes are triggered. So if you only have 25 bones in your character and add another 25 for the face the performance impact is always 100%.regarding to the situation where you dont have those bones.
For us we finalliy decided to have LODs and only have the blend shapes on LOD0. (they are corrective).
We might do another measurement in the new unity 2019.2. (we have a problem with gpu skinning and blend shapes with 2019.1).