Forum Discussion
vajra3d
11 years agoHonored Guest
To vsync or not to vsync.... that is my question
After reading a lot of negative comments about using vsync earlier on I was under the impression that it was best to not use it. But the BP guide mentions having the code run at 60fps vsynced. So, which way should we go?
With the probability of the CV1 using an OLED screen does that mean that we'll still be req'd to run our games in vsync mode or will it no longer be necessary given the high freq of the display?
Also, would the decision to use vsync depend on whether or not you have a fast or slow moving game? Could you possibly get by w/o vsync if your game is very slow-paced or would it still be necessary?
With the probability of the CV1 using an OLED screen does that mean that we'll still be req'd to run our games in vsync mode or will it no longer be necessary given the high freq of the display?
Also, would the decision to use vsync depend on whether or not you have a fast or slow moving game? Could you possibly get by w/o vsync if your game is very slow-paced or would it still be necessary?
6 Replies
Replies have been turned off for this discussion
- renderingpipeliHonored Guesttldr: vsync
You want to avoid tearing as it is worse in VR than on a normal screen (try it). It breaks immersion and is distracting. As long as we don't have 120Hz GSync HMDs, VSync is the only way to prevent tearing and get best immersive results (if done at 60Hz/95Hz/120Hz or whatever the (next) Rift supports. - drashHeroic ExplorerSome users (me!) prefer the lower latency of having vsync off and are perfectly OK with slight screen tearing (the kind of tearing from having vsync off, that is). The thing is, the DK1 has a bit of motion blur which probably masks the screen tearing anyway so for right now it's probably fine to do for the users that don't mind tearing.
Having said that, if your demo/game isn't able to run much higher than 60fps without vsync, I personally don't perceive much of a benefit from keeping vsync off, but I'm not too sure on that. I do seem to feel a big difference when a game can run at hundreds of frames per second (without vsync) even if the refresh rate is still 60hz.
Bottom line, if a demo/game can do the following things, I generally would be a happy user:- Give the user the option to toggle Vsync.
- Adjust the prediction time in accordance with whether Vsync is on or off. (For Unity, 20 millseconds with Vsync off, 40 milliseconds with Vsync on, but it may depend on your particular demo -- maybe best to try it out and in each case see what values reduce/eliminate the swimming effect). And/or just let the user adjust his/her own prediction to whatever feels right for them.
Of course, all of this may go right out the window when new Rift hardware comes along, or if Unity makes under-the-hood rendering pipeline updates. - vajra3dHonored GuestThanks for all the great info... that helps a lot! So if I'm getting an average of 200fps in the rift then would you recommend keeping vsync off by default (when offering the player the choice between the two)?
FYI, I'm testing w/ an HD7950 and am getting about 215fps in the Tuscany demo. To be more accurate I have three areas and I'm getting 170, 200, and 250 fps in each (w/ SSAA and 4xMSAA combined). So would you recommend keeping vsync off by default or would that be pushing it you think?
Thanks again for the info! - BaseDeltaZeroHonored GuestI would suggest giving the user the option to turn it on or off, this can easily be done with the script below.
using UnityEngine;
using System.Collections;
public class Vsynctoggle : MonoBehaviour {
protected bool Vs = false;
// Update is called once per frame
void Update () {
if( Input.GetKeyDown(KeyCode.Y))
{
Vs = !Vs;
}
if (Vs)
{
QualitySettings.vSyncCount = 0;
}
if (!Vs)
{
QualitySettings.vSyncCount = 1;
}
}
} - drashHeroic Explorer
"drash" wrote:
Adjust the prediction time in accordance with whether Vsync is on or off. (For Unity, 20 millseconds with Vsync off, 40 milliseconds with Vsync on, but it may depend on your particular demo -- maybe best to try it out and in each case see what values reduce/eliminate the swimming effect). And/or just let the user adjust his/her own prediction to whatever feels right for them.
I just wanted to come back to this thread to say I just had a "whoa" moment re: vsync. I'm currently working with a project where the framerate is very high, but it fluctuates quite a bit. And yet when trying it in the Rift (without vsync @ 20ms prediction), I kept getting the odd feeling that the framerate was slugglish even when it wasn't, and it just didn't feel right. Then I turned Vsync on (w/ the corresponding change to prediction value to 40ms). Whoaaaa that was beautiful. I am finally seeing the light re: vsync being good for immersion, big time.
I'm suspecting that since the Oculus Unity integration's OVRCameraController prefab defaults to a prediction value of 0.03, it wasn't quite in tune with how Unity shows 40ms in the latency tester with vsync on? (Assuming those two numbers are actually apples to apples.)
Anyway, I know this was my own suggestion, but I didn't realize just how well it worked until now. Hopefully it's not a fluke. :o - vajra3dHonored GuestThanks for the code basedeltazero. ;)
Hey drash, so glad you caught this! I just did some tests like you mentioned and am getting the same results you just reported. If I set it to vsync at 40ms I get a much smoother experience with no noticeable lag but with vsync off and set to 20ms I get a lot of lag - even at 200fps!
I will try to play with this some more and see if I can dial in the timing w/o vsync on and see if I can improve it but as it is now it seems to me that vsyncing at 60fps w/ 40ms works very well.
Thanks a lot for following up on this! ;)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 years ago
- 4 months ago
- 9 years ago
- 6 months ago
- 11 years ago