3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
349 stars 30 forks source link

animation rate clamped to 30fps #116

Closed claudeha closed 4 years ago

claudeha commented 4 years ago

Describe the bug Can't preview animations faster than 30fps. My screen is 60fps.

To Reproduce Steps to reproduce the behavior:

  1. Set OpenGL refresh rate in preferences to 16ms, framerate to 60fps
  2. Set up cheapest frag imaginable
  3. Activate animation
  4. See framerate is 30fps, which is less than desired 60fps

Expected behavior Clamping of animation speed is controlled by preferences.

Desktop (please complete the following information):

Additional context Other software can render at 60fps.

3Dickulus commented 4 years ago

goto Edit->Preferences and set OpenGL refresh rate to 1/60 = 16 ms

this is the rate that the gui will try to refresh the GL area, minimum is 1 because 0 does not allow the gui to operate properly

although it seems to max out at 30 fps here too... ??? not sure why, it used to run at what ever was set in prefs... and of course it will only run at that rate if the frag can render in about half that time due to overhead... yes, thorough testing is required before adding or altering features...

3Dickulus commented 4 years ago

after some testing it seems that setting the refresh rate has no impact on framerate ???

3Dickulus commented 4 years ago

Qt eventLoop trigger is at 30hz, using update() applies this limit current video device is at 60hz, calling paintGL() directly instead of update() yields 60fps

can replace update() with paintGL() but have to do all of the stuff Qt::eventLoop() does or nothing gets updated.

to go beyond 60fps (on my system) sync GL with video device needs to be disabled in Xserver/GLsettings edit: this leads to image tearing as the GL is not in sync with device Vsync

3Dickulus commented 4 years ago

looking into rearranging the timerSignal() drawToFrameBufferObject() and paintGL() routines to allow display device max frame rate... hopefully Qt::eventLoop won't cause problems like rendering the same frame twice because the widgets and stuff are poled at 30Hz, if that is the case this may lead to a move away from Qt for GL rendering, keyframe and uniform translations.

3Dickulus commented 4 years ago

untested beyond 60Hz