General ideas to handle entities with unique meshes with animation?

Hey,
I hope you can give me some general idea/guideline on how I should proceed and think in terms of ECS.
For my project I want to have a lot of “people” with each of them have a different mesh + material.

I am not quite sure on how to actually think about it, because for the movement I can just have one system which handles all that, while each entity has it own different data (in localtransform), and my thought is that I would be kinda the same when I have another set of entities which has the component for the mesh-rendering, but the data (the actual mesh) is always different.
…But I dont find any resources and all the examples I looked into are like 1-set of mesh-A, 1-set of mesh-B and so on, so you have multiple jobs that handles each set, and ofcourse its done like that because you assign component-A with mesh-A, and component-B with mesh-B, so different sets of entities, but my “people” should actually be one set, the only thing different should be the mesh.

I didnt got soo far, but maybe you could give me some advice, especially if its comes to the animation. Do I have to bake for each mesh its own animations, or can I share those vertex-animations with different meshes? (For my people, the base would be the same, only the clothing is different)

I know its a broad question to ask, but I hope you could give my a simple insight on how you would proceed with that kind of problem.

Greetings!

Use skeletal animation. That way your mesh doesn’t need to know about the animation data, just the bones.

If you need GPU animation, you can store bone animations in textures, and then in your vertex shader you look up the bone indices and weights to figure out where to sample in the texture, and then blend your bones together. You can also store bone animations in buffers, which is a little more advanced.

If you only need let’s say <50k characters, I wrote this: Latios-Framework-Documentation/Kinemation Animation and Rendering/README.md at main · Dreaming381/Latios-Framework-Documentation · GitHub
One of its superpowers is that it has a runtime binding system, so you can instantiate your skeleton, and then instantiate your skinned mesh separately and target it to the skeleton. The main use case for this is for character customization, but it would also be useful for your use case too.

1 Like

Thank you, already checking it out! Awesome work!