-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and clean up skeletal animation in Irrlicht #15722
base: master
Are you sure you want to change the base?
Conversation
This reverts commit e1becd8.
…d (this is in the spec)
3a0fa29
to
c9b1981
Compare
c9b1981
to
c08a92d
Compare
Tried on a random game. Got this: |
Ah yes, someone is probably using an animatable mesh format for a static mesh. I've added a check to not call
Feel free to do it at a later point in time, I wouldn't rush it for 5.11 anyways. Thanks for the brief test, that's already helpful. |
Re-do-ish of #15354.
Fixes skeletal animation / attachment related jank, specifically fixes #14818 and fixes #14817 and refactors much of the code in preparation of e.g. #9218. See also #15350.
It works by doing things the way they should be done. Currently we have Irrlicht doing things wrong and 2-3 layers of workarounds, some in Irrlicht, some in Luanti, on top of it. This is a broken mess.
What should be done is conceptually pretty simple: First, we need to recursively update the absolute transforms of node hierarchies consisting of scene nodes (including bones) inside
OnAnimate
.When rendering, we simply transfer these transforms to the mesh and let it do the CPU skinning. (Later we will want to do that on the GPU.)
Each animated scene node must store its own bone transformations for animation blending purposes (and later GPU skinning).
All the workarounds we currently have can essentially go out the window.
I believe my changes here should also optimize things, but I haven't benchmarked yet.
To do
This PR is ready for review. I ask you not to focus on minor style issues (for example I suppose I might not have applied casing consistently; sometimes I'm using Luanti, sometimes Irrlicht conventions) but rather broader issues until the very end of reviewing where I'll do one big sweeping pass to get rid of them.
How to test
.x
,.gltf
/.glb
,.b3d
- still animate correctly. As a starting point, the models included in devtest should still work correctly: Lava Flan, Cool Guy, Sam, Animated Frog, Animated Spider.CAnimatedMeshSceneNode
rendering code, setDebugDataVisible = scene::EDS_BBOX
.)player_api/api.lua
and change theanimation_blend
(which is in seconds). Then observe e.g. how when going from standing to punching, your right arm is raised smoothly over the given timespan. In general, transitions between animations should appear smoothened.character_anim
.The commits are only semi-useful for reviewing this.