In this Unity tutorial you will learn how to bake animations as a series of "snapshots" of meshes. These snapshots can be taken at a configurable framerate that suits your game.
The concept here is attacking a similar problem as Animation Instancing: blog.unity.com/technology/ani..., but is still handled by the CPU and does not require any "shader magic" to manipulate the vertices.
It also does not reduce the Draw Calls, as Animation Instancing will do. Instead, this approaches the problem by resolving the "CPU Skinning" taking up a lot of CPU time on the main Unity thread to improve FPS.
This can be taken one step further to batch all the meshes into a single draw call per material via Graphics.DrawMeshInstanced(): docs.unity3d.com/ScriptRefere...
Strangely, with my initial attempt, the performance was actually worse than what is implemented here. I didn't have time to dive into that and the performance here was "good enough" for my use case.
💸 Ongoing Sales 💸
⚫ See all active asset sales on the Asset Store: assetstore.unity.com/?on_sale...
⚫ Save 25% off your first Asset Store Order: prf.hn/click/camref:1101l9QvC...
⚫ Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
👨💻 As always, the full project code is available on GitHub: github.com/llamacademy/baked-...
📚 Resources
⚫ Bake Skinned Mesh Renderer Mesh: docs.unity3d.com/ScriptRefere...
⚫ Graphics Draw Mesh Instanced: docs.unity3d.com/ScriptRefere... /
⚫ Animator Play: docs.unity3d.com/ScriptRefere...
⚫ Animator Update: docs.unity3d.com/ScriptRefere...
⚫ "Woodsman the Peasant" video that inspired this one: • How To Make Crowds In ...
📱 Let's stay connected
KZitem: / llamacademy
Patreon: / llamacademy
Facebook: / llamacademyofficial
Twitter: / thellamacademy
TikTok: / llamacademy
Instagram: / llamacademy
----
Believe in LlamAcademy's mission and have received value from the videos? Consider becoming a Patreon supporter: / llamacademy
----
Most tutorials come from knowledge gained making survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.
I also have some Unity Assets: assetstore.unity.com/publishe...
Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
#unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment
Chapters:
00:00 Problem Statement - SkinnedMeshRenderers at Scale.
01:01 A Solution - Precomputed or "Baked" Animations
02:16 Key Components - AnimatedMeshScriptableObject.cs
02:21 Key Components - AnimatedMesh.cs
02:55 Creating Baked Animations with an Editor Script
03:46 Bake Your Animations!
05:23 Animator Considerations when Baking
06:37 Become a Supporter!
07:03 When is this a viable option, and when is it not?
Негізгі бет Bake Your Animations to Greatly Improve Performance...For Some Use Cases | Unity Tutorial
Пікірлер: 74