A forked expansion of Mesh Animation by VladV, a lightweight library for rendering hundreds of meshes in one draw call with GPU instancing.
Mesh Animation is a wonderful lightweight implementation and pipeline for GPU/Shader animation. For my purposes I am expanding it and changing some approaches, so here it is.
- Shader now receives time as a property block parameter instead of using _Time in the shader for more control at runtime.
- To step time, call MeshAnimator.DoUpdate(float deltaTime). Lets you batch updates and/or update less frequently.
- Animations are called and referenced via AnimationClip and not string for increased safety and more available metadata.
- Animation crossfading and queueing. Crossfade is normalized so aligned animations like Walk->Run will blend gait properly.
- Speed multiplier, including 0 and negative.
Issues
- Currently no support for non-looping anims. All animations will loop.
- The Unlit shader is not currently compatible with the above changes.
- There is an older Asset Store package called Mesh Animator. I would like to rename this whole thing to GPUAnimator, but I didn't want to break the diffing or make pull requests disorganized yet.
- You will need to write your own code to call DoUpdate on each MeshAnimator. I may include something for this like a Manager script.
- First, you need to install Tri Inspector - Free and open-source library also by VladV which provides a number of interesting Inspector features, similar to Odin. It's used mostly in the Bake UI.
- Make sure after installing Tri Inspector to run the installation package in its instructions.
- If you still get compile errors at that point, reimport the Tri Inspector folder in the Project window.
- With Tri Inspector installed, put https://github.com/benthroop/GPUAnimator.git into Unity Package Manager to install this package.
- Done.
Mesh Animation bakes vertex positions for each frame of animation to texture. Custom shader then move mesh vertexes to desired positions on GPU. This allows draw the same original mesh multiple times with GPU Instancing. Unique animation parameters are overridden for each instance with Material Property Block.
- Supported up to 2048 vertices per mesh.
- Bakes one SkinnedMeshRenderer animation per prefab.
- Requires special shader for vertex animations.
- Animations can only be baked in editor mode.
- Possibly low animation quality on some GPUs.
- Vertex animation may be not supported on some old devices.
- Create Mesh Animation Asset (in
Assets/Create/Mesh Animationmenu). - Assign skin, shader and animation clips fields in inspector.
- Click
Bakebutton. - Assign generated material to gameObject.
- Add
MeshAnimatorcomponent to gameObject. - Play animation from code.
- Add TestMeshAnimator.cs which will call DoUpdate(float deltaTime) on MeshAnimator. Assumption is you write your own.
Works with Humanoid or Generic. Does not works with legacy.

