f3d: Animation freeze when interacting with mouse
Steps to reproduce
./bin/f3d BoxAnimated.gltf- zoom out
- press space
- move the scene while animation is running
- animation is not smooth
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 26 (26 by maintainers)
Thanks for the investigation on this @exbluesbreaker ! I removed the skip frames code and in combination with your VTK fix this issue is fixed!
I think I can analyze this issue more and check other details.
Probably “skip frame” logic is needed but should be reworked somehow. I commented it out just in a brief checking differences with F3D 1.3.0.
Ok! At least it is a bit better 😃
It worked much better at least on my mini-PC which I used at the time I worked with issue (it doesn’t have the best GPU and CPU). In fact, there were still probably slows a bit as rendering of camera movement goes and only then animation, but with old implementation I was literally able to freeze animation update for seconds while moving scene with the mouse.
Maybe let me revisit it once I finish current stuff with ImGui console.
It seems something is wrong with
animationManager::Ticktimings when mouse is being moved and maybe it is related tostd::chrono::steady_clockusage.I checked internal duration counter in
animationManager::Tickusingstd::chrono::steady_clockand it actually shows always perfect duration, despite me seeing freezes of animation and even delay of debug output of this value. So I usedstd::chrono::high_resolution_clockto measure time betweenTickcalls and this clock is able to detect big delays properly.Anyway, I will keep investigation.
I am working on this issue. So far it seems it is not problem of rendering being blocked somehow, but of animated object geometry not being updated while mouse movement.
I forced calling
this->RenderUI(that)invtkF3DImguiObserver::MouseMovewhich commened not being necessary and freezing is the same. So it tries to render quite actively but object “doesn’t move”Its BoxAnimated.gltf from testing/data.