Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Calin Leafshade on Thu 14/01/2010 11:58:10

Title: Does VSync actually work?
Post by: Calin Leafshade on Thu 14/01/2010 11:58:10
I've been messing around with the vsync property and as far as i can tell it doesn't seem to do anything.

Is it functional? because image tearing is a real problem at the moment.
Title: Re: Does VSync actually work?
Post by: Danman on Thu 14/01/2010 12:13:03
Isn't Vsync for too many frames for the monitor to handle so you get half the frame or image tearing. I am not too sure about it. I never knew AGS had Vsync. But anyway maybe your graphics card has it turned off.
Title: Re: Does VSync actually work?
Post by: Calin Leafshade on Thu 14/01/2010 12:19:58
Not quite, Vsync basically forces your graphics card to wait until the backbuffer has been fully drawn to before rendering it to the screen therefore making sure it draws a complete frame each time.

But it doesnt seem to work regardless of my video card settings.

Title: Re: Does VSync actually work?
Post by: Jim Reed on Thu 14/01/2010 12:25:53
Playing with the game speed might yield results. Try setting it to your display refresh rate or half that.

Try your game on another computer.
Title: Re: Does VSync actually work?
Post by: Danman on Thu 14/01/2010 12:30:19
Yeah the refresh rate might help I remember reading somewhere about that.  I read that if the frame rate is higher than the refresh rate you get image image tearing.
Title: Re: Does VSync actually work?
Post by: Calin Leafshade on Thu 14/01/2010 12:41:15
Well Haloa just kinda PMed me and told me that Vsync only works on DirectDraw mode at full screen. And he seems to be right.

So any other limitations on vsync are engine related? CJ?
Title: Re: Does VSync actually work?
Post by: Ryan Timothy B on Thu 14/01/2010 12:45:29
Quote from: Jim Reed on Thu 14/01/2010 12:25:53
Try setting it to your display refresh rate or half that.
Curious, isn't syncing the game speed to the monitor only really possible with an old CRT monitor? (like I said, curious.  I really have no idea)


For example, my lcd screen is 60hz, and I've had my game run at 100fps (just to play around :P) and I haven't notice a difference between 100 or even 20.
Title: Re: Does VSync actually work?
Post by: Danman on Thu 14/01/2010 12:51:16
I have an evil computer that can run any game.i am on a 19inch wide screen at 60hz refresh rate. I have never had image tearing myself. With games that run at 100 frame rate either. I think it depends on the make of the monitor and graphics card
Title: Re: Does VSync actually work?
Post by: subspark on Fri 15/01/2010 14:43:49
This lack of fullscreen v-sync in DX9 mode is kind of pissing me off. Especially since we have a lot of camera/viewport movement going on in our game.

Our 320x200 game is running at 1280x800 (4x NN) but there are other 640x400 games I've seen that run at 2560x1600 (4x NN).

Is there an ETA on when we can expect V-Sync to work in DX9 at full screen?

Cheers,
Sparky.
Title: Re: Does VSync actually work?
Post by: TheMagician on Sat 16/01/2010 14:32:04
I must admit I've never understood how V-Sync works and what the variables are on which it depends.
However, I can confirm that it only works in fullscreen DirectDraw 5 games in AGS.
Title: Re: Does VSync actually work?
Post by: LimpingFish on Sat 16/01/2010 20:33:48
All I know is that v-sync helps prevent screen-tearing when using the Panorama modules. Windowed and full-screen.
Title: VSYNC and tearing in DX9
Post by: xenogia on Sun 24/01/2010 04:42:28
I have noticed when full screening my game which is running at 1280x800 (from 640x400) it tears quite a lot especially when it plays a video.  Is there a way around this.. I have read this isn't an issue with DX5, but my game uses DX9 acceleration as it is needed.
Title: Re: Does VSync actually work?
Post by: Pumaman on Sun 24/01/2010 18:39:23
Direct3D doesn't support dynamically enabling/disabling vsync while the game is running, but it does support starting the game up with vsync enabled. This would need some sort of new Winsetup option since by the time your game_start function runs, with D3D it's too late to set the vsync.
Title: Re: Does VSync actually work?
Post by: subspark on Sun 24/01/2010 20:10:45
So will you add support for V-Sync for DX9? Tearing is quite obvious at full-Screen.

Cheers,
Sparky.
Title: Re: Does VSync actually work?
Post by: Pumaman on Sun 24/01/2010 20:27:35
Yes, I am planning to do so in a future version.
Title: Re: Does VSync actually work?
Post by: xenogia on Sun 24/01/2010 22:00:14
I guess in the meantime, just run it in a window.. It doesn't tear for me that way.
Title: Re: Does VSync actually work?
Post by: Igor on Sun 27/03/2011 08:43:04
Was this problem solved? It seems Vsync still works under DirectDraw only.
Title: Re: Does VSync actually work?
Post by: Calin Leafshade on Sun 27/03/2011 15:38:48
I wrote a plugin called AGSVSync (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=41669.0) (which can be found on the forum) that enables vsync on D3D games.
Title: Re: Does VSync actually work?
Post by: Igor on Sun 27/03/2011 19:15:54
Thanks Calin! I'll give it a try.

Edit- it works great :)
Title: Re: Does VSync actually work?
Post by: Pumaman on Sun 03/04/2011 18:57:04
Quote from: Igor on Sun 27/03/2011 08:43:04
Was this problem solved? It seems Vsync still works under DirectDraw only.

No, not yet. It's not a complex change, just needs Winsetup to be updated to have a Vsync checkbox when running in D3D mode. Probably should be done for hte next version.