XiaJun
XiaJun

Reputation: 1925

My limited FPS : 60

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 little complicated.Actually,my computer is bought last year and the performance is good.The graphics card is nVidia GTX570,CPU is I7.

So I make a experiment:run the same program on my computer and my friend's computer.This program implements shadow mapping:

enter image description here

The FPS in my computer is about 60. But when I run it in my friend's computer,The FPS is more than 400. enter image description here

But my computer's performance is obvious better than his.Now I post our computer's parameter.

My computer:

tgt.init (Info)  GLEW version: 1.7.0
tgt.GpuCapabilities (Info)  OS version: Windows 7 (build 7600)
tgt.GpuCapabilities (Info)  OpenGL Version: 4.2.0
tgt.GpuCapabilities (Info)  OpenGL Renderer: GeForce GTX 570/PCIe/SSE2
tgt.GpuCapabilities (Info)  GPU Vendor: NVIDIA Corporation (NVIDIA)
tgt.GpuCapabilities (Info)  Texturing: yes, max size: 16384, 3D: yes, max 3D size: 2048
tgt.GpuCapabilities (Info)  Texture features: 32 units, NPOT, rectangles, compression, 16x anisotropic
tgt.GpuCapabilities (Info)  Framebuffer Objects: yes, max 8 color attachments
tgt.GpuCapabilities (Info)  Shaders: yes (OpenGL 2.0), GLSL Version 4.20, Shader Model 5.0
tgt.GpuCapabilitiesWindows (Info)  Graphics Driver Version: 8.17.12.9573
tgt.GpuCapabilitiesWindows (Info)  Graphics Driver Date: 2012-02-09
tgt.GpuCapabilitiesWindows (Info)  Graphics Memory Size: 1280 MB

My friend's computer:

 tgt.GpuCapabilities (Info)  OS version: Windows 7 Service Pack 1 (build 7601)
tgt.GpuCapabilities (Info)  OpenGL Version: 4.2.11566 Compatibility Profile Context
tgt.GpuCapabilities (Info)  OpenGL Renderer: AMD Radeon HD 6620G
tgt.GpuCapabilities (Info)  GPU Vendor: ATI Technologies Inc. (ATI)
tgt.GpuCapabilities (Info)  Texturing: yes, max size: 16384, 3D: yes, max 3D size: 8192
tgt.GpuCapabilities (Info)  Texture features: 16 units, NPOT, rectangles, compression, 16x anisotropic
tgt.GpuCapabilities (Info)  Framebuffer Objects: yes, max 8 color attachments
tgt.GpuCapabilities (Info)  Shaders: yes (OpenGL 2.0), GLSL Version 4.20, Shader Model 5.0
tgt.GpuCapabilitiesWindows (Info)  Graphics Driver Version: 6.14.10.11566
tgt.GpuCapabilitiesWindows (Info)  Graphics Driver Date: 2012-03-09
tgt.GpuCapabilitiesWindows (Info)  Graphics Memory Size: 512 MB

I am very curious and I cannot figure it out.Should I do some settings for the graphics card?Could some one tell me how to solve the problem?

Upvotes: 19

Views: 22866

Answers (3)

Kos
Kos

Reputation: 72319

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

Upvotes: 27

Jerry Coffin
Jerry Coffin

Reputation: 490693

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.

Upvotes: 9

Thomas
Thomas

Reputation: 182083

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.

Upvotes: 21

Related Questions