-
Notifications
You must be signed in to change notification settings - Fork 297
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
Damping and world damping is framerate dependent #81
Comments
This problem is also apparent if you use Global Time Dealation. You get more bouncing when using GTD for a slomo effect since this plugin calculates on each frame instead of based on the Game Time delta between frames. I'm not comfortable enough in C++ yet to try to fix this right now. :( |
@ElusiveFluffy Both variants still get a big jiggle if you get a sudden frame drop/stutter. Anyway thanks for sharing! Also you have a typo at the end: |
Yeah, it doesn't fully fix the issues with it, but overall it works a bit better at different framerates, I'm still want to try some other things. I don't think I've noticed the big jiggle from that, but I also haven't tested that much. Oh, I didn't notice that or edit that line, that was how it originally was in the plugin |
Have you solved the problem of performance being affected by frame rate now? |
I never really figured out how to 100% solve it, may need a complete rewrite or something. I did find a weird way that mostly fixes it but at really low and high fps (like below 20fps, and above around 240 I think) it doesn't work as well. I've tried multiple different things using delta time and this is the best I got This function is in the file Source/KawaiiPhysics/Private/AnimNode_KawaiiPhysics.cpp, the SimulateModifyBones function its around line 504, just replace the whole function with this and recompile (This is different from the code above that I sent before)
|
The world damping values get run every frame, so the higher the framerate the more dampening that happens (most noticeable with long bone chains). At lower FPS it will be more bouncy, but as you increase the max FPS it becomes less bouncy and just goes straight, making the physics not look as good.
Heres a video example showing what I mean, can see it the most in the tail
Editor.77.mp4
I have found a possible fix but isn't the best implementation to target how it looks at a specific FPS.
This is what I did to make it consistent across all framerate unless its lower than target fps, the edit is in "AnimNode_KawaiiPhysics.cpp" (and "AnimNode_KawaiiPhysics.h" to add cumulativeDeltaTime to each bone, had issues if not all bones had their own value for some reason), for some reason though this code randomly stops working for some physics nodes, maybe because I don't know much about C++. (I tried using delta time but couldn't figure out how to get it to work well)
The text was updated successfully, but these errors were encountered: