Advertisement

Root motion baking and playback

Started by August 03, 2020 03:43 PM
0 comments, last by FrontBack 4 years, 4 months ago

Hi everybody, I need some help on solving a problem which I haven't the faintest idea on how to solve it. Basically, I'm implementing my own GPU animation instancing and I'm stuck at implementing root motion. I can already sample an animation with no effort, but I don't know exactly what to save that makes most sense (absolute TRS? relative?) and then again, I don't know how to apply it correctly given the current animation state (I have 4 animations per layer with their own weights, with 4 layers with their weights aswell).
With all the methods I tried, I only got exaggerated root motion or considerable drifting. (I made a capture to explain what happens, the highlighted object is the one controlled by Mecanim as a reference, the other one is handled by my system https://drive.google.com/file/d/1LZBT2H20NnTDFTiX7xxZYEz5Rd30Mc7O/view?usp=sharing)

At the moment I save the absolute TRS of each animation frame (I sample everything at 60 FPS), then at runtime I compute the TRS at the previous state, the one at the current state, then apply the delta to the transform, and if necessary I add an offset equal to the TRS of the last frame in the animation to handle looping animations. Do you guys have any ideas?
Hope I explained everything clearly enough. I'm Using Unity 2019.4.1f1.

This topic is closed to new replies.

Advertisement