-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
setFrameRate on lwjgl3 leads to too slow frame rate #1455
Comments
There are some other problems in runLoop, jme3-lwjgl's version of this seems much more complicated (necessarily so) calling Sync.sync which runs a longer average thereby avoiding the problem |
Awesome! I'll stop investigating in that case. Should this issue be closed or should it stay open till the PR is merged? |
I'm fine leaving this open. It might help someone solve a similar issue. And it's not like we're going to clear out the backlog anytime soon... |
richtea reported this issue fixed in 3.4.0-beta1: https://hub.jmonkeyengine.org/t/engine-v3-4-0-beta-testing/44507/5 |
Issue
When running JME with jme3-lwjgl3 the AppSettings#setFrameRate method call does not work correctly, causing far lower frame rates that requested. My application, when unlimited runs at around 60 fps, but when limited runs as follows:
This only occurs with jme3-lwjgl3, jme3-lwjgl works fine
Investigation so far
I've had a look in the debugger at what's going on in LwjglWindow#runLoop and on line 564 I see it trying to figure out how long to sleep for:
final double sleep = frameSleepTime - (timer.getTimePerFrame() / 1000.0)
However, timer.getTimePerFrame() appears to always return zero, leading to it always sleeping for the full 1/frameRate. Meaning if the application is under any sort of load that brings it close (or worse below) to the requested frame rate it slows the application way below the requested rate.
This appears to be because
Timer#update
is never called (a different times update method is called, but not the one inLwjglWindow
Environment
I'm running
3.3.2-stable
but I've also checked out and run against the V3.3 branch and it behaves the same (master looks like it would have the same problem but crashes for me)The text was updated successfully, but these errors were encountered: