VSync is using lowest monitor refresh rate instead of the selected one.

Started by CodeBunny, November 01, 2012, 13:37:43

Previous topic - Next topic

CodeBunny

[Not 100% certain this is the bug, but it certainly seems undesirable.]

My monitor has a couple of different refresh rates it can use - 50, 59, and 60 fps respectively. I have it set to refresh at 60 (the default rate).

However, it seems like when LWJGL goes fullscreen, the monitor starts refreshing at the lowest possible rate - 50 fps, in this case, instead of the 60 that I'm targeting. Thus, when I start using VSync, the game only allows 50 frames to execute per second because Display.update() blocks until the repaint.

Any idea why this is happening/how to fix?

Fool Running

A couple questions:
1) Are you using VSync with Display.Sync()?
2) Is your monitor actually at 50 hz, or is it at 60hz but LWJGL is only drawing 50fps?
3) Without VSync are you able to get 60+ fps (i.e. it can actually draw 60 times per second)?
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

CodeBunny

1: Yes. My standard game loop includes Display.sync(); the only modification I make to allow vsync is to set the flag in Display.
2: It seems like my monitor is actually running at 50fps - every frame looks perfect, it just allows fewer per minute.
3: Yes. I turn off vsync and it runs at normal speed - however, there is rather extreme tearing (6 frame updates are fit into 5 screen repaints).

I should also note that this is dependent on the monitor. I have a 2-monitor setup where the other has different display options (60 or 75 hz), and the problem does not occur when I use it as the primary display.

Fool Running

If you take out Display.Sync when VSync is on, does the problem still persist (I would guess so, but I want to make sure to eliminate that possibility)?

How are you creating your display (Using the Display.Create with no parameters or specifying a display mode)? Have you tried doing the opposite?

Also, can you look at your monitor to double-check what Hz it is running at (i.e. looking at the monitor settings, not the settings in the OS)?

Sorry for so many questions, just trying to eliminate variables. ;)
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

CodeBunny

Ah, got it. When selecting fullscreen modes, I wasn't ensuring the correct refresh rate. Thanks! :D