My limited FPS : 60

后端 未结 3 1575
灰色年华
灰色年华 2021-02-19 00:54

I have learn OpenGL programming for some time.And I found a very strange phenomenon : my FPS(Frame per Second) always stays about 60,no matter the program is very easy or a litt

相关标签:
3条回答
  • 2021-02-19 01:25

    What @Thomas said, it's VSync.

    You can disable it in your applicaton using:

    • GLFW: glfwSwapInterval(0); (0 = off, 1 = on)
    • SDL: SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0);
    • FreeGLUT: I'm not aware of this being possible, use your GPU settings as a fallback
    0 讨论(0)
  • 2021-02-19 01:28

    In the nVidia Control Panel:

    enter image description here

    The vertical sync setting is the one you care about. For benchmarks like this, you normally want it set to off.

    0 讨论(0)
  • 2021-02-19 01:29

    This is vsync at work. Your monitor runs at 60 Hz, so there's no point in rendering more frames. And by limiting the framerate in that way, there will be no tearing artifacts.

    Probably there is a setting in your driver's control panel to enable or disable vsync forcefully, or to leave it up to the application.

    If you use an OpenGL framework like GLUT or GLFW, that probably also has an option to explicitly request vsync, or to turn it off (which is useful for benchmarking). Not all drivers/settings will honour this, though.

    0 讨论(0)
提交回复
热议问题