Skip to content

Accurately trigger the preview slider update based on FPS#26

Merged
liruilong940607 merged 8 commits intonerfstudio-project:mainfrom
RongLiu-Leo:main
Jun 8, 2025
Merged

Accurately trigger the preview slider update based on FPS#26
liruilong940607 merged 8 commits intonerfstudio-project:mainfrom
RongLiu-Leo:main

Conversation

@RongLiu-Leo
Copy link
Copy Markdown
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.
@liruilong940607
Copy link
Copy Markdown
Collaborator

Sry for the delay! Thanks for the fix! I dont see any issue for this one. So I'm merging it

@liruilong940607 liruilong940607 merged commit bd802d7 into nerfstudio-project:main Jun 8, 2025
1 check passed
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.

2 participants