Bone animation - CPU or GPU?

Hi,

I got a question about skinned meshes. Does Unity apply bone animation to the skinned mesh with CPU or GPU?

If it use GPU, the performance should be much better but the transformed mesh cannot be used for calculation within script, i.e. doing manual calculation of line-intercept-triangle.

On the other hand if it use CPU, when will be the time it actually transform the mesh? Between Update() and LateUpdate()? If so, then procedurally changing the bones in the LateUpdate() should be useless because the mesh has already been morphed.

My guess is that Unity use GPU to transform the skinned meshes, can someone confirm that?

If it is indeed done by the GPU, how can I put a bullet hole decal mesh onto a running person if I cannot do a line-intercept-triangle on the skinned mesh?

People are doing a fair bit of morphing on skinned meshes so I am probably correct in assuming its on the CPU and should be performed in Update, which is called just before the render.

I am pretty sure that bones are tramsformed after Update() and before LateUpdate(), so people do procedural animation on bones in the LateUpdate().

And since we can still modify bones transformation in LateUpdate() means that at this time the skinned meshes haven’t been morphed yet.

If Unity use CPU to morph the meshes after LateUpdate(), but before render, then when is a good time for us to write line-intercept-triangle in? Within OnPreRender() ? That doesn’t sound right…

I actually have to choice between BoneSkinning and MorphBlending in order to do facial animation.
I do MorphBlending on CPU (I think there is no way to do it in Unity via GPU), and use the Unity’s standard BoneSkinning technique.
So if BoneSkinning is doing on CPU the 2 method are time equivalent, so I really have to know it…

Up an official reply please :slight_smile: !

it IS on the CPU.

Just perform it in lateupdate.

Any skinning is done on CPU.
With Unity 3.4 it will be offloaded to a different thread though for some platforms (see the official blog), which might or might not have an impact