Skip to content
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

Camera spins unevenly at <=100 FPS rendering speed #4794

Closed
roym899 opened this issue Jan 12, 2024 · 7 comments · Fixed by #4885
Closed

Camera spins unevenly at <=100 FPS rendering speed #4794

roym899 opened this issue Jan 12, 2024 · 7 comments · Fixed by #4885
Labels
😤 annoying Something in the UI / SDK is annoying to use egui Requires egui/eframe work 🏎️ Quick Issue Can be fixed in a few hours or less

Comments

@roym899
Copy link
Collaborator

roym899 commented Jan 12, 2024

Once the displayed CPU time reaches ~= 10ms, the camera spins at uneven speed for me.

uneven_spin.mp4

Rerun Version

rerun_py 0.12.0 [rustc 1.74.0 (79e9716c9 2023-11-13), LLVM 17.0.4] x86_64-unknown-linux-gnu release-0.12.0 afa112e, built 2024-01-09T17:56:39Z

Desktop (please complete the following information):

  • Ubuntu 22.04
@roym899 roym899 added 😤 annoying Something in the UI / SDK is annoying to use 👀 needs triage This issue needs to be triaged by the Rerun team labels Jan 12, 2024
@roym899 roym899 changed the title Camera spins unevenly at <= 60 FPS rendering speed Camera spins unevenly at <=100 FPS rendering speed Jan 12, 2024
@emilk emilk added 🏎️ Quick Issue Can be fixed in a few hours or less and removed 👀 needs triage This issue needs to be triaged by the Rerun team labels Jan 12, 2024
@roym899
Copy link
Collaborator Author

roym899 commented Jan 12, 2024

Maybe also adding here that the same scene didn't have this issue back in 0.8 (or at least much less) and that the spinning speed has increased noticeably since then.

080.mp4

Same for 0.9. Faster rendering (2x faster than now), and consistent spinning speed.

@Wumpf
Copy link
Member

Wumpf commented Jan 12, 2024

@emilk not sure this is a "quick issue". The code hat does the spinning looks like this:

            orbit_eye.rotate(egui::vec2(
                -response.ctx.input(|i| i.stable_dt).at_most(0.1) * 150.0,
                0.0,
            ));

so if high framerates cause issues here it implies that stable_dt isn't working properly

@roym899
Copy link
Collaborator Author

roym899 commented Jan 12, 2024

I tried out some more versions and it seems like this has changed from 0.11 -> 0.12.

Each frame takes ~2x as long, the rotation speed is higher, and the speed seems to be inconsistent.

@emilk emilk added the egui Requires egui/eframe work label Jan 12, 2024
@emilk emilk added this to the 0.12.1 milestone Jan 16, 2024
@Wumpf
Copy link
Member

Wumpf commented Jan 16, 2024

@roym899 and me had a look on his laptop where it's reportedly not as bad as on the desktop - we'll check on puffin traces of the desktop machine later.

It seems that we slightly regressed performance in 0.12 it's hard to pinpoint where exactly though. However, (likely due to multithreading!) we have much more varying frame time lengths and I think this doesn't bode well with stable_dt. The visual effect is in fact the camera spin seems to speed up and slow down at random, giving a jittered impression.
@emilk how is stable_dt measured and is that even what we should be using here? Feels like we should just use a regular frame dt.

@emilk
Copy link
Member

emilk commented Jan 16, 2024

The docs explains it pretty well: https://docs.rs/egui/latest/egui/struct.InputState.html#structfield.stable_dt

Feel free to try out some other dt

@emilk
Copy link
Member

emilk commented Jan 17, 2024

Ooh, it seems stable_dt is broken in egui since the big multi-viewport refactor! Will fix :)

@emilk emilk removed this from the 0.12.1 milestone Jan 17, 2024
@emilk
Copy link
Member

emilk commented Jan 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
😤 annoying Something in the UI / SDK is annoying to use egui Requires egui/eframe work 🏎️ Quick Issue Can be fixed in a few hours or less
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants