-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Optimize animation blend tree process #68593
Optimize animation blend tree process #68593
Conversation
34261ef
to
a4e467d
Compare
e2534dd
to
814ac6e
Compare
814ac6e
to
51252e8
Compare
51252e8
to
17ce879
Compare
Thanks! |
This (or something related) may have caused the regression described in #69066 |
I think that issue has already been fixed in the follow-up PR, see #68993. |
Off topic, but something about those Suzanne-headed humanoids feels very uncomfortable. Where can I get them? |
There it is in the project for benchmarking uploaded by @JoanPotatoes2021 in #65199 (comment), but I don't know if you can use it as you want, just ask @JoanPotatoes2021. Yeah, Humanoid Suzanne is not cute, but I think it's nice as the enemy model. |
Optimize animation blend tree process.
Fixes #65199 (Partially)
In #57675 and #62623, for blending result consistency, it was necessary to blend animations even if the blend amount is 0 or don't have sync option.
The fundamental reason of this is that the blend values are initialized only on the track that will be blended in the only one frame that is just played.
Consistent blending by correct initialization:
1.mp4
Inconsistent blending due to lack of initialization on certain tracks:
2.mp4
This PR separates the initialization process and iterates through the TrackCache instead of the track that will be blended at that frame. This greatly reduces calculation cost while keeping the blending consistency. Well, this is just a re-implementation of the optimization that #57675 removed.
I confirmed that this would increase the FPS of the #65199 (comment) project at running by about 1.5 times.
Before:
After:
Also, these are the projects to check whether this PR will not change the behavior:
animation_blend_test.zip
character_controller_3d_sample.zip
As far as I have checked, this PR should not change the behavior of the blending, but I welcome anyone who is interested to test it. This is mention to people I remember talking about optimization before: @JoanPotatoes2021 @and-rad
This process optimization was the biggest issue, so I think we can now close #65199 for now. If this does not solve the problem of frame rate dropping with panning viewport, then perhaps it is a problem other than blending.