Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / VSync problems

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 4th Dec 2015 19:39
I have some ongoing issues with vsync().

Although I use timer based movement, I usually offer an option for vsync in the settings but I find a common problem with both vsync and timer based movement using syncrate(), getframetime() etc.

There appears to be an assumption in AppGameKit that vsync() should work at 60hz; not true.

My monitor refreshes at 59hz at 2560x1440 . This causes a blip every second or so, which causes a jerk in sprite movement as well as an offset tear which travels up/down the screen.

So, is vsync() hard coded to 60hz? I've used setsyncrate(59,1) or similar and can affect the tear/jumping somewhat, but this isn't any good for every other non-60hz monitors out there.

For comparison, I can set my monitor to 60hz only if I drop the resolution to 1920x1080. Everything is fine then. Put it back to the default res of 2560x1440, it can only operate at 59Hz and problem persists.



Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 5th Dec 2015 13:07
there are a command to get the frametime,
GetFrameTime
but it said its limited to max 0.2 seconds.
the real time u can get with Timer(), it should reset with ResetTimer () after awhile because precision.

Quote: " I use timer based movement,"

be careful, a variation in time can result in stutter
AGK (Steam) V2.0.15d : Windows 10 Pro 64 Bit : AMD (15.201.1151.0) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 5th Dec 2015 16:37 Edited at: 5th Dec 2015 16:38
That's what I have always used, but doesn't make any difference on a 59Hz refresh - you still have to bond the frametime to some kind of speed control e.g.



I then multiply my usual movement with gMasterTimer.Adjust#
However, on a 59Hz monitor, this causes glitching of course. VSync() also seems to assume 60hz

What we need is a function to return the monitor refresh rate.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 5th Dec 2015 20:37
hmm, it is a little bit odd.
i know from game settings full hd is only 59 hz listed.
if me not set the sync rate my monitor show 60 hz and the values are not stable.
if me set to 59 hz inside agk with SetSyncRate the values are stable but my monitor still show 60hz.
it seems the screenfps command give the best value.




AGK (Steam) V2.0.15d : Windows 10 Pro 64 Bit : AMD (15.201.1151.0) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 6th Dec 2015 01:18
Well, it's going to be related to what refresh the monitor uses. Do you have a monitor that can operate above 1080p?

My monitor will force 60Hz up to and including 1080p, but 59Hz for resolutions above that.

Those higher resolutions are the problem.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 17th Dec 2015 19:26
* Bump *
Can Paul confirm this issue with <>60Hz refresh?
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Dec 2015 22:46
We support VSync up to 200Hz, above that AppGameKit assumes something went wrong and limits the frame rate to 200 fps. The actual VSync rate is determined by the GPU, we don't give it any values we just tell it to use VSync. Note that on Windows Vista and above we use the Desktop Window Manager to handle VSync instead of OpenGL, but again we just turn it on and it decides when to refresh. Multiple monitors can also affect VSync as it might not sync with all the monitors.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 17th Dec 2015 23:02
I have 3 monitors all with different resolutions and refresh rates and can't say I've noticed any nasty vsync tearing. Could this be a problem with your graphics card driver settings? For example, the NVIDIA config page for vsync shows me this:

Quote: "
In Windows Vista, turn Vertical sync on and off in the NVIDIA Control panel for OpenGL games such as Doom, Quake, and Chronicles of Riddick. For applications that use Direct3D on Windows Vista, use the vertical sync setting within the application.
In Windows XP, turn the Vertical sync on and off in the NVIDIA Control for both OpenGL and Direct3D games and applications.
Force vertical sync off when performance is more important than image quality for benchmarking.
Select "adaptive" to turn vertical sync on or off based on the frame rate. Vertical sync will only be on for frame rates above the monitor refresh rate. This provides a good compromise between quality and performance by eliminating tearing at high frame rates while avoiding excess performance loss at lower frame rates. This option also reduces power consumption.
Select "Smooth" to smooth the frame-time patterning for SLI.
Select "G-Sync" to get the best visuals with low latency and no tearing."


It might be worth having a play with your settings if you haven't tried already.

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 3rd Mar 2016 17:21
I think the problem would be best solved by having a function that returns the current sync rate (from Windows).

If I'm making my own timer based movement, then I need to know what frequency to sync to.

So if I'm using:



then it's always going to glitch on a 59Hz display. How do I know it's 59Hz though so I can alter the calculation?

Login to post a reply

Server time is: 2024-11-25 10:45:29
Your offset time is: 2024-11-25 10:45:29