Optimize Animated Model rendering with hardware instancing

All models are using the same global buffer for skinned bones which allows to share shader binding for instancing.
Refactor draw call for batching skinned mesh draws.
Remove `SkinnedMeshDrawData` and merge it into `AnimatedModel` internals.
This commit is contained in:
2026-06-15 17:59:41 +02:00
parent 4d1c627900
commit bc36168318
26 changed files with 430 additions and 367 deletions
+1 -1
View File
@@ -1089,7 +1089,7 @@ bool ModelTool::ImportModel(const String& path, ModelData& data, Options& option
// Special case if imported model has no bones but has valid skeleton and meshes.
// We assume that every mesh uses a single bone. Copy nodes to bones.
if (data.Skeleton.Bones.IsEmpty() && Math::IsInRange(data.Skeleton.Nodes.Count(), 1, MODEL_MAX_BONES_PER_MODEL))
if (data.Skeleton.Bones.IsEmpty() && Math::IsInRange(data.Skeleton.Nodes.Count(), 1, (int32)MODEL_MAX_BONES_PER_MODEL))
{
data.Skeleton.Bones.Resize(data.Skeleton.Nodes.Count());
for (int32 i = 0; i < data.Skeleton.Nodes.Count(); i++)