OpenGL全屏渲染
我目前正在用 openGL 编写一个游戏,并且已经到了一个阶段,我处于第一人称模式,用 W & 控制“相机”。 S,用鼠标旋转。
由于某种原因,当我处于窗口模式时,我移动和旋转的速度似乎比全屏模式下的速度快得多,但这不是我的主要问题。 (*1)
由于上述原因,我决定将游戏限制为全屏。
我的关卡是一个立方体,每面都有不同的 RGB 颜色,当我快速移动鼠标时,关卡的角会变得非常块状,直到我放慢速度。 (*2)
任何人都知道这两个问题(*1、*2)发生了什么。
我尝试截图给大家看,但是截图中看起来很正常。
I'm currently coding a game in openGL and I've got to a stage where I'm in first person mode controlling the "camera" with W & S, and rotating with the mouse.
For some reason, when I'm in windowed mode, the speeds at which I move and rotate seems MUCH faster than the speeds I get when In fullscreen, but that's not my main issue. (*1)
As a result of the above, I decided to restrict the game to fullscreen.
My level is a cube where each side is a different RGB colour and when I move my mouse very quickly, the corners of the level turn very blocky until I slow down. (*2)
Anyone got any idea what's going on for either the questions (*1, *2).
I tried to screenshot it for you guys, but it looks normal in the screenshot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 glutGet(GLUT_ELAPSED_TIME) 测量帧时间:
如果帧时间在 16-17 毫秒左右,则很可能存在一些垂直同步。管理垂直同步取决于系统,无论是访问方法还是可靠性:(
你最好的选择是 frame -速率独立性,因此无论你跑得有多快/慢,你都会做正确的事。
Measure your frame times with
glutGet(GLUT_ELAPSED_TIME)
:If they're around 16-17ms you most likely have some vsync. Managing vsync is system-dependent, both in access method and reliability :(
Your best bet is frame-rate independence, so you do the Right Thing no matter how fast/slow you're running.