Adds GPU skinning support via compute shaders.

We use a shader with 64 bones by default to consume less uniform memory.
But if we meet bigger skeletons we batch and handle them afterwards.
In the future we need to sort the input models to have less changes for
bound buffers. Also we might want to skin up to 4 models per a single
dispatch.
This commit is contained in:
Vladislav Belov
2024-12-09 22:47:17 +01:00
parent 9e371824c2
commit de1257c8da
15 changed files with 616 additions and 135 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2024 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -91,8 +91,8 @@ public:
// (TODO: sort out the timing/looping problems)
const size_t boneCount = skeleton.GetBoneCount();
if (boneCount > 64)
Log(LOG_ERROR, "Skeleton has too many bones %zu/64", boneCount);
if (boneCount > 192)
Log(LOG_ERROR, "Skeleton has too many bones %zu/192", boneCount);
std::vector<BoneTransform> boneTransforms;