Open tqwewe opened 10 months ago
Bevy by default has the worst possible input latency. IE: it polls input right after the end of the previous frame, resulting on input latency of exactly one frame, even without counting accidental lag caused by bad system ordering. Using bevy_framepace
might help a bit https://crates.io/crates/bevy_framepace
@nicopap This is a usefull advice, thanks. I will try it if there is a difference. Bevy_Lunex currently uses a dummy entity to track cursor, so you can style it. Notice the bloom of the cursor for example. It pulls cursor data, puts it as transform on entity and then that is used. So there might even be 2 frame delay. I will try to add option to style native cursor sprite instead, which was recently merged in winit. Altough, its kinda surprising you noticed this delay. When OS cursor is hidden, I can't tell the difference, but that might be because of my 165hz display.
I've tried setting the present_mode
to PresentMode::Immediate
, since I noticed it was capped at 60fps, and this definitely removed the input delay feeling.. though I was getting over a thousand FPS at that point.
I'm not sure why it was capped at 60fps since my monitor is 144hz.
(Btw the background moving graphic was animating super fast with a higher FPS compared to a lower FPS).
I added bevy_framepace
to have a more reasonable FPS (around 400), and this also felt just fine to move the mouse. Though still not as crispy as styling the native cursor I'd say.
Btw, not related but when I clicked "Quit Game" in the UI, I got a segfault:
fish: Job 1, './bevypunk' terminated by signal SIGSEGV (Address boundary error)
Thanks for building such an awesome showcase!
I just compiled it and tested it myself, though there's quite a noticeable delay when moving my mouse to click buttons. I ran in release mode, and my PC is quite powerful with a 4070, so its definitely not my PC under performing.
Any ideas where this delay might be coming from?
For context, here's some of the logs I see when running the app:
And I'm on Linux