Sign in to follow this  
MrFRag

Opengl Speed Problems

Recommended Posts

Hi everyone, I'm developing a game, but I'm having some strange problems: the code I've developed works good on my pc (about 250 - 300 fps) but if I give it to my friends it works at about 70fps, even on pc with a video card faster than mine! How can it be possible? I'm using an ati radeon 8500 with 64mb of ram, and the game is compiled with Dev C++, for rendering I'm using opengl and it's extensions. I thought it was a problem due to vsync, but nothing change with it enabled or disabled.

Share this post


Link to post
Share on other sites
Quote:
Original post by mrbastard
maybe they have older drivers?


I don't think, but they have no problems running other games...

Share this post


Link to post
Share on other sites
That definately stinks of vsync problems. I would say: don't care, unless drawing more things make it drop even lower than 70fps.

Share this post


Link to post
Share on other sites
v-sync is the process of showing the backbuffer in unison with the refresh rate of the display device. Your friend can probably control v-sync options somewhere in his graphic card settings.

Share this post


Link to post
Share on other sites
If you check your friend's monitor setting you probably will see his monitor refresh rate set to 70mhz. VSync is used by the monitor to tell the video card when to draw the next frame because the current sync is done. Disabling vsync simply tells the video card to keep sending data to the monitor as fast as possible hence why 200fps is achievable.

Share this post


Link to post
Share on other sites
I've tryed to enable vsync on my pc using wglSwapInterval(1); and i'm running at about 70fps too now, but the movements seems "laggy", specially when i rotate the view around me. I've read some articles talking aboput triple buffering to solve this problem, do you think it's a good solution or is there something better?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'm foreseeing that the "laggy" rotation is caused because the rotation interpolation isn't calculated based upon time passed. Now that you've enabled v sync and limited yourself to 70 fps, your code that is responsible for the rotation is now only executing at 70 fps (instead of the previous 250-300fps) which will obviously feel a lot slower/laggy.

Share this post


Link to post
Share on other sites
correct me if i'm wrong, you mean my code is something like this right?

...
while (!exit) {
...
rotate_camera()
render()
swapbuffers()
}
...

so i update the camera at every frame.

Instead of a code of this type, i'm using directinput to get the inputs from keyboard and mouse, but i update the camera position and rotations (using a quaternion based class) at regular intervals using two timers (one for mouse and the other one for keyboard), so, my code is something like this:

...
timers initialisation()
while (!exit) {
mouse.getStatus() //i read the status stored in the class
render()
swapbuffers()
}
...

Windowprocedure() {
if (message = WM_TIMER)
if (timerId = mouse) {
//using directinput, i update the status of the mouse object
mouse.updateStatus()
}
}

Share this post


Link to post
Share on other sites
Maybe I've solved my problem:

I've noticed that the laggy effect was less if moving only with keyboad, so i thought about windows messages. I've modifie my code, now, when in the message queue i find messages related to mouse or keyboards, i just skip and delete them. The game works fluid now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this