Mythruna
May 11, 2024, 04:57:44 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: What is "Vsync"  (Read 7411 times)
Vander
Newbie
*
Posts: 6


View Profile
« on: July 14, 2012, 02:27:22 PM »

I was just wondering about this one option on start-up for Mythruna that's called Vsync, what does it do to the game?
Logged
ahmadsal
Jr. Member
**
Posts: 90


View Profile
« Reply #1 on: July 14, 2012, 03:49:37 PM »

There are a couple things you should know first. There is a frame rate for both your monitor (refresh rate) and the game. A frame rate is how fast, in frames per second (fps), the screen/program runs at. What you see is basically a bunch of still images displayed about 60 fps normal (the higher the better) so that it looks almost seamless.

Vsync (vertical sync) reads both the fps of the monitor and the game and determines if it needs to slow down the game. This may seem weird to slow the game but if your monitor is running 60fps and the game is running 100fps, sometimes you would get tearing in what you see. This happens more on earlier monitors (such as xp) but can still happen anywhere.

Basically, play the game and see if there is tearing in the video (you will notice it if it happens). Textures won't look normal, just google for images. If tearing occurs, turn vsync on. If tearing does not occur, you can leave it off to have a higher frame rate. Basically, it just adapts your system to fix problems, and isn't needed if the problems don't occur.

Hope you understand (it is a bit hard explaining a concept in a post)
Logged
Vander
Newbie
*
Posts: 6


View Profile
« Reply #2 on: July 14, 2012, 04:51:56 PM »

Yea I get what you mean, I'm  a beginner in computer programming and want to be a video game programmer, its just that I've never encountered that option before. Thanks for the information.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #3 on: July 14, 2012, 06:34:25 PM »

Yea I get what you mean, I'm  a beginner in computer programming and want to be a video game programmer, its just that I've never encountered that option before. Thanks for the information.

More specifically, this option kind of has deep roots in old CRT displays.  There was a period of refresh where the cathode ray would go from the bottom corner to the top corner to start drawing the screen again.  The period this gun traveled was commonly known as "vertical blank" or "vblank"... at least that's my memory.

Since forever it's been possible to synchronize your graphics code to this vertical retrace so that you could do work between screen refreshed.  This would also prevent you from doing strange things like modifying graphics memory while the screen was refreshing leaving partially rendered images.

Well, that's a history lesson anyway.

Really, your monitor can only refresh at a fixed frequency... generally 60 hz.  It doesn't matter how fast the game is rendering because you will only ever see 60 frames per second.  So when I run Mythruna and I get 240 FPS on some area, I'm still only seeing 60 frames per second.  The game is just rendering an extra 180 frames that I never see.  In fact, in full screen it's sometimes still possible to see artifacts called "tearing" if you turn too fast while at a frame rate significantly higher than your monitor's refresh... you will end up seeing part of two frames.  In other words, the image looks torn with the bottom part skewed from the top part.

Vsync forces the game to wait until one frame is drawn and dispatched before continuing.  (Actually, I believe it's actually that before dispatching the next frame it makes sure the previous one has completed... since then the game gets to still render the next frame while the previous one is displayed... but I digress).  You will never see more than the refresh rate as FPS in this case and the game can spend time doing other things like physics and AI and generally being nicer to your system.  It isn't wasting time drawing frames nothing will see.

The only down side is that it can exaggerate performance problems.  For example, if a frame consistently takes just slightly longer than 1/60th of a second then instead of getting 57 or 58 FPS, you might drop a full multiple down to 45 FPS or 30 FPS (depending on how steady the delay is).

When running/playing the game, vsync is really the "right" way.  Leaving it off is a good way to test performance (which is why I do it) or to brag about your system specs (Dudez, I totally got 600 FPS in full screen!!!)... but it's making the whole system work harder for no good reason.
Logged
ahmadsal
Jr. Member
**
Posts: 90


View Profile
« Reply #4 on: July 15, 2012, 11:34:21 AM »

Well, that's a history lesson anyway.

hehe, I'm only 18. I've only used CRT with my win98 about 10 years ago, and those things weren't strong enough to run half of a modern internet browser, let alone a game.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #5 on: July 15, 2012, 01:07:16 PM »

Well, that's a history lesson anyway.

hehe, I'm only 18. I've only used CRT with my win98 about 10 years ago, and those things weren't strong enough to run half of a modern internet browser, let alone a game.

You can drive a color CRT with a modern graphics card, no problem.  I still have a few around the house.
Logged
BenKenobiWan
Friendly Moderator
Donators
Hero Member
***
Posts: 674


Jesus loves you!


View Profile
« Reply #6 on: July 15, 2012, 04:33:05 PM »

Last time I used a CRT was last Thursday.
Logged
Vander
Newbie
*
Posts: 6


View Profile
« Reply #7 on: July 15, 2012, 08:24:49 PM »

Quote
When running/playing the game, vsync is really the "right" way.  Leaving it off is a good way to test performance (which is why I do it) or to brag about your system specs (Dudez, I totally got 600 FPS in full screen!!!)... but it's making the whole system work harder for no good reason.
Thanks for all the information, its really given me some background on graphics.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!