Return back to marek-knows.com Member Community
Game Development, 3D Modeling, Art, Sound Effects and more


Physics VMK 1 - Vertical Synchronization

 
Post new topic   Reply to topic    Member Community Forum Index -> Physics Engine VMK
View previous topic :: View next topic  
Marek
Site Admin


Joined: 11 Feb 2007
Posts: 515
Location: Ontario Canada

 PostPosted: Thu Jan 10, 2008 8:42 am    Post subject: Physics VMK 1 - Vertical Synchronization Reply with quote Back to top

In VMK 1A I explain the inner workings of the vertical synchronization feature built into a computer's video card and monitor. I then show you how to disable it so that we can get the game engine running at more than the standard 60 fps.

VMK 1B/C demonstrates how to add a check box to the Options Menu that will allow you to turn vertical synchronization on and off, while the game engine is running.
 
View user's profile Send private message
BugHunter



Joined: 06 Aug 2008
Posts: 180
Location: Russia

 PostPosted: Sun Sep 07, 2008 6:51 pm    Post subject: Reply with quote Back to top

Oh, the tutorial is spectacular. You certainly have a talent to explain the concepts. Smile

Probably the only thing that also should be mentioned is a double buffering, which is a standard in 2D/3D graphics. It increases the smoothness of animation and reduces the flickering of the screen, allowing to switch vertical synchronization off with minimal detriment to user’s experience.

If somebody is interested to know more about WGL_EXT_swap_control extension, here is a link to official description:
http://www.opengl.org/registry/specs/EXT/wgl_swap_control.txt
In particular it gives more detailed explanation of the parameter to BOOL wglSwapIntervalEXT(int interval):
Quote:

The parameter <interval> specifies the minimum number of video frames that are displayed before a buffer swap will occur...


In addition to all that, it is rumored that you cannot disable V-Sync if it is prohibited in the options of video-driver.
 
View user's profile Send private message
Groggy



Joined: 04 Sep 2009
Posts: 18

 PostPosted: Mon Apr 19, 2010 11:21 pm    Post subject: Reply with quote Back to top

I've watched the vid. and I understand how to turn off vsync, but I'm not sure why you would want the vid. card to work harder than it has too.

Does the program stop after completing the frame and has to wait 7ms before it continues or is it just the vid. card that stops for 7ms?

If the program stops, then I can understand turning vsync off. But if it's just the vid. card waiting to display the buffer, then whats the harm in waiting? You're writing data to a buffer which no one is seeing anyways. Or have I missed something?

thanks.
 
View user's profile Send private message
BugHunter



Joined: 06 Aug 2008
Posts: 180
Location: Russia

 PostPosted: Tue Apr 20, 2010 3:18 am    Post subject: AFAIK - SwappBuffers() blocks the main thread Reply with quote Back to top

When the vertical synchronization is ON the function SwapBuffers() inside the main application loop blocks the execution thread of the application. So, as you said, the program stops and waiting.
The main reasons to turn V-Sync off are:
1) estimate the top performance of the hardware/software
2) if actual application’s FPS is less than monitor’s refresh rate it may in some circumstances increase the apps performance.
Rolling Eyes
 
View user's profile Send private message
Groggy



Joined: 04 Sep 2009
Posts: 18

 PostPosted: Tue Apr 20, 2010 10:12 am    Post subject: Reply with quote Back to top

Thanks, was wondering about #2 also Smile
 
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Member Community Forum Index -> Physics Engine VMK All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum