Skip to content

Accurately trigger the preview slider update based on FPS #26

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

RongLiu-Leo
Copy link
Contributor

Problem

Slider → Preview Camera Updates
Whenever the slider’s value changes, it recomputes and updates the preview camera’s position.

Two Tasks

  1. Play Mode
    • Animates a green camera along the trajectory.
    • After receiving the camera updates, uses time.sleep(1/fps) between updates to pace the animation.
  2. Preview Mode
    • Sets the user’s camera to the preview pose and renders frames.
    • No Sleep, so updates fire as fast as possible, outpacing the renderer and causing visible jumps.

Windows Limitation

  • time.sleep() on Windows cannot reliably pause for very precise intervals, especially at high frame rates.

This PR

Accurate Timing with time.perf_counter()

  • Tracks elapsed time since the last update.
  • Ensures at least 1/fps seconds have passed before applying the next slider change.
  • No need for all downstream sleep() calls in both modes.

Future Considerations

Sustaining High FPS

  • If the user requests a high frame rate, can the system truly maintain 1/fps-second response times under load? I think this is the bottleneck for current FPS-timer logic.This PR performs better but still jumps given a high FPS.

Send–Ack–Send Handshake

  • A more robust approach would wait for the renderer’s acknowledgement before scheduling the next update.
  • Pros: Guarantees no dropped or out-of-order frames.
  • Cons: May introduce back-pressure and reduce overall throughput; requires performance testing.

RongLiu-Leo and others added 8 commits May 20, 2025 16:25
fix jumping green camera vis
Update the slider using fps accurately
It seems the resolution adjustment only makes fps worse and renders more blurry.
Disable it temporarily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant