我有限的FPS:60 [英] My limited FPS : 60

查看:149
本文介绍了我有限的FPS:60的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学习OpenGL编程已经有一段时间了,而且我发现了一个非常奇怪的现象:我的FPS(每秒帧数)总是保持在60左右,不管程序是非常简单还是有点复杂。其实,我的电脑是买的所以我做了一个实验:在我的电脑上运行相同的程序,我的朋友的电脑上运行了相同的程序。 computer.This程序实现阴影映射:



但是当我在朋友的电脑上运行它时,FPS超过了400美元。$ b b


$ b

$ b

我的电脑:

我的电脑:

tgt.init(Info)GLEW版本:1.7.0
tgt.GpuCapab ilities(Info)操作系统版本:Windows 7(build 7600)
tgt.GpuCapabilities(Info)OpenGL版本:4.2.0
tgt.GpuCapabilities(Info)OpenGL渲染器:GeForce GTX 570 / PCIe / SSE2
tgt.GpuCapabilities(Info)GPU供应商:NVIDIA Corporation(NVIDIA)
tgt.GpuCapabilities(Info)纹理:是,最大尺寸:16384,3D:是,最大3D尺寸:2048
tgt .GpuCapabilities(Info)纹理特征:32个单元,NPOT,矩形,压缩,16x各向异性
tgt.GpuCapabilities(Info)Framebuffer对象:是,最多8个颜色附件
tgt.GpuCapabilities(Info)着色器:是(OpenGL 2.0),GLSL版本4.20,Shader Model 5.0
tgt.GpuCapabilitiesWindows(Info)图形驱动程序版本:8.17.12.9573
tgt.GpuCapabilitiesWindows(Info)图形驱动程序日期:2012-02-09
tgt.GpuCapabilitiesWindows(Info)图形内存大小:1280 MB

我朋友的电脑:

  tgt.GpuCapabilities(Info)操作系统版本:Windows 7服务包1(内置7601)
tgt.GpuCapabilities(信息)OpenGL版本:4.2.11566兼容性配置文件上下文
tgt.GpuCapabilities(信息)OpenGL渲染器:AMD Radeon HD 6620G
tgt.GpuCapabilities Info)GPU供应商:ATI Technologies Inc.(ATI)
tgt.GpuCapabilities(Info)纹理:是,最大尺寸:16384,3D:是,最大3D尺寸:8192
tgt.GpuCapabilities纹理特征:16个单元,NPOT,矩形,压缩,16x各向异性
tgt.GpuCapabilities(Info)Framebuffer对象:是,最大8个颜色附件
tgt.GpuCapabilities(Info)Shaders:yes(OpenGL 2.0) ,GLSL版本4.20,Shader Model 5.0
tgt.GpuCapabilitiesWindows(Info)图形驱动程序版本:6.14.10.11566
tgt.GpuCapabilitiesWindows(Info)图形驱动程序日期:2012-03-09
tgt。 GpuCapabilitiesWindows(Info)图形内存大小:512 MB

我非常好奇,我无法弄清楚。我应该为显卡做一些设置吗?有人可以告诉我该如何解决这个问题? 解决方案

这是 vsync 。您的显示器以60 Hz运行,因此渲染更多帧没有意义。通过这种方式限制帧速率,不会有撕裂工件



可能在驱动程序的控制面板中有一个设置来强制启用或禁用vsync,或者将其留给应用程序。



如果您使用像GLUT或GLFW这样的OpenGL框架,可能也有明确请求vsync或关闭它的选项(这对基准测试非常有用)。不过,并不是所有的驱动程序/设置都会符合这个要求。


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:

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

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?

解决方案

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.

这篇关于我有限的FPS:60的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆