GPU SkinnedMesh Instancing

Have you ever tried to instantiate thousands of animated skinned meshes in a Unity scene? Even with GPU Skinning enabled and baked skinned meshes, the Animation Class on every instance is consuming all your CPU resources.

As there is no way to write 32F in RenderTexture and proceed like DirectX10 technique (see below), I used DirectX11 and ComputeBuffers to bake mesh topology and animations for GPU processing. Then I use a compute shader to iterate through these buffers, calculating and transmitting data to a classic render shader that draws every vertices and triangles of the instantiated mesh according an animation buffer.

There is no shadow handling yet but diffuse and specular lights are working nicely.

This technique has a caveat though;
I see 3072 peaceful men on screen and no women. If you put just one “skinned” woman into this scene, FPS would drop significantly (since all men would try to do different animations then they normally do, to attract the woman) and if you put 2 women into that scene, all men will start watching the women having a cat fight.
Those are the problems you will be facing if you continue this.
You’ve been warned!

Thanks guys for your reply.
I’m very busy right now. I need to do some refactoring and packaging before putting this on the asset store… like many of my other plugins 🙁 But the agency where I work asked me to finalize the GPU SkinnedMesh Instancing for an internal project. So, in a near futur, I will be able to finalize this. And I hope Unity will give to ability to handle shadows with DrawProcedural method soon…