Jump to content


Photo

Adaptive Vsync in The Dark Mod


  • Please log in to reply
24 replies to this topic

#1 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9433 posts

Posted 04 February 2019 - 08:05 AM

Hark There!

 

During the 2.07 development cycle, there were a few discussions about exclusive fullscreen that verged

into the topic of Vsync.

 

Because of this, I did a little research about what Vsync options OpenGL offers and tried to compare what

we have in our GL libraries.

 

To my great surprise, we use OpenGL's native "Swap Interval" feature to perform Vsync and it passes the

exact value you supply it directly to the driver.

 

This means that The Dark Mod has Adaptive Vsync ( swap interval -1) and probably has had it for years.

 

I tested this out and it seems to work for me but I'd like to know if this only works for Nvidia (etc).

 

Please try this out:

 

1) Start TDM

2) Open the console: CTRL + ALT + ~

3) Enter r_swapInterval -1

 

Then play a mission where you know FPS drops below 60. (No Honor Among Thieves, Briarwood Manor, etc.)

 

What you should see is that FPS is capped to 60 but the game does not drop you straight to 30FPS when you

go below 60.

 

It will be easier to tell if it's working if you pair it to uncapped FPS.


  • stgatilov, jaxa, Anderson and 1 other like this
Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#2 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 04 February 2019 - 08:20 AM

Hark There!

 

During the 2.07 development cycle, there were a few discussions about exclusive fullscreen that verged

into the topic of Vsync.

 

Because of this, I did a little research about what Vsync options OpenGL offers and tried to compare what

we have in our GL libraries.

 

To my great surprise, we use OpenGL's native "Swap Interval" feature to perform Vsync and it passes the

exact value you supply it directly to the driver.

 

This means that The Dark Mod has Adaptive Vsync ( swap interval -1) and probably has had it for years.

 

I tested this out and it seems to work for me but I'd like to know if this only works for Nvidia (etc).

 

Please try this out:

 

1) Start TDM

2) Open the console: CTRL + ALT + ~

3) Enter r_swapInterval -1

 

Then play a mission where you know FPS drops below 60. (No Honor Among Thieves, Briarwood Manor, etc.)

 

What you should see is that FPS is capped to 60 but the game does not drop you straight to 30FPS when you

go below 60.

 

It will be easier to tell if it's working if you pair it to uncapped FPS.

Addendum:

30 for who has the Monitor Refresh Rate set to 60 Hz (60->30->15)

36 for who has the Monitor Refresh Rate set to 72 Hz (someone with an old but gold analogue monitor, 72->36->18)

 

I'm testing now!


Edited by lowenz, 04 February 2019 - 08:22 AM.

  • Taquito. likes this

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#3 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 04 February 2019 - 08:30 AM

I'm testing now!

It's working :D

 

So the TDM players have 3 choices/options for the VSync:

1) Use the "default" double buffered output (r_swapinterval 1)

2) Use the "default" double buffered output (r_swapinterval 1) forcing the triple buffering via NVCP/Radeon Settings (first create a TDM dedicated profile)

3) use the Adaptive VSync (r_swapinterval -1)

 

2/3 are nearly-equivalent.

 

Todo for 2.08: add 3) in plain text in the video options menu.


Edited by lowenz, 04 February 2019 - 08:32 AM.

  • jaxa and Taquito. like this

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#4 chakkman

chakkman

    Advanced Member

  • Member
  • PipPipPip
  • 1117 posts

Posted 04 February 2019 - 08:39 AM

What you should see is that FPS is capped to 60 but the game does not drop you straight to 30FPS when you

go below 60.

 

The funny thing is that TDM did that for quite a while now for me (for a couple of years), without me having changed anything in the configuration... 



#5 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 04 February 2019 - 09:17 AM

Maybe in your driver control panel ;)


Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#6 chakkman

chakkman

    Advanced Member

  • Member
  • PipPipPip
  • 1117 posts

Posted 04 February 2019 - 09:19 AM

Not that i'm aware of... at least i didn't change anything there. In regards to VSync.


Edited by chakkman, 04 February 2019 - 09:20 AM.


#7 OrbWeaver

OrbWeaver

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 7599 posts

Posted 04 February 2019 - 09:56 AM

My experience aligns with chakkman's. My first experiments with Doom 3 on Windows (in about 2005) showed that with default driver settings, my frame rates were not limited to integer divisions of the monitor refresh rate, unless I was running in a window with the editor open. I was under the impression that this is the behaviour you see with triple buffering, and does not require anything called "Adaptive VSync" (which I don't remember ever seeing in the driver settings, and I certainly never set r_swapInterval to anything unusual).

 

@nbohr: are you absolutely sure that Adaptive VSync does what you think, because it seems like the non-framerate-dropping behaviour you are describing is also a characteristic of straightforward triple buffering?



#8 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 9433 posts

Posted 04 February 2019 - 10:15 AM

I'm not sure when things changed but I do recall numerous support threads where players complained of dropping to 30FPS

and disabling vsync was the cure.

 

In my own case, if I set:

 

r_swapInterval 1  anything lower than 60FPS drops to 30FPS

 

r_swapInterval 0 No 60 FPS threshold. If I uncap FPS I can go to the max 160hz

 

r_swapInterval -1  I am capped to 60FPS but I do not drop to 30FPS when I go below 60FPS

 

If it behaves differently on other hardware\drivers it would be good to know whether there is any logic to that

or if it's just vendors falling outside of standards compliance.


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#9 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 04 February 2019 - 04:15 PM

Adaptive VSync behaviour is simple:

*No Sync under the refresh rate value of FPS

*Sync above


Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#10 chakkman

chakkman

    Advanced Member

  • Member
  • PipPipPip
  • 1117 posts

Posted 04 February 2019 - 04:25 PM

What you should see is that FPS is capped to 60 but the game does not drop you straight to 30FPS when you

go below 60.

 

I just realized that i understood this the other way around. Guess i'll try out the console hack then. :)



#11 OrbWeaver

OrbWeaver

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 7599 posts

Posted 05 February 2019 - 05:03 AM

Right, so Adaptive VSync does indeed solve the half-framerate problem and behave in the way that nbohr suggested, however triple buffering should also solve this (at least with vanilla Doom 3; perhaps something is different in the standalone mod which makes triple buffering behave differently).

 

Therefore I would suggest trying triple buffering first, because it should avoid the half framerate without negating the benefits of vsync (removing tearing). If triple buffering doesn't solve the problem, Adaptive VSync ought to be a solution (if the game does support it).



#12 The Black Arrow

The Black Arrow

    Member

  • Member
  • PipPip
  • 70 posts

Posted 05 February 2019 - 05:42 AM

From my experience and some, now rather antique articles about Adaptive VSync and the AMD equivalent...

Adaptive VSync is only good and some rumour works only when Triple Buffering is also enabled.

 

My personal experience has always been that in-game VSync is terrible, and any adaptive VSync is bad, only through Control Panel is it actually good and with Triple Buffering enabled.

 

Also, it seems that "Maximum Pre-Rendered Frames" does make a huge difference in mouse responsiveness, I tried this comparing 1 to 4, using a very cheap gaming mouse.

 

I haven't tried anything in here, but I'm going to give it a try, with OpenGL's and Nvidia's Adaptive VSync.



#13 OrbWeaver

OrbWeaver

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 7599 posts

Posted 05 February 2019 - 05:48 AM

My personal experience has always been that in-game VSync is terrible, and any adaptive VSync is bad, only through Control Panel is it actually good and with Triple Buffering enabled.

 

What does it mean for VSync to be "terrible" versus "bad" vs "good"? VSync does one specific thing (link buffer swaps to monitor refresh to avoid tearing), so I don't understand how you can have good or bad vsync. Do you mean the in-game settings do not work, or that you get screen tearing even with VSync supposedly enabled?



#14 The Black Arrow

The Black Arrow

    Member

  • Member
  • PipPip
  • 70 posts

Posted 05 February 2019 - 05:56 AM

 

What does it mean for VSync to be "terrible" versus "bad" vs "good"? VSync does one specific thing (link buffer swaps to monitor refresh to avoid tearing), so I don't understand how you can have good or bad vsync. Do you mean the in-game settings do not work, or that you get screen tearing even with VSync supposedly enabled?

 

Oh yes, sorry, I should have explained better.

 

By what I mean is that the dreaded "60 to 30 FPS" (I have 60hz, numbers will vary for other refresh rates), the occasional stutters and the mouse input lag happens way more often than usual.

 

Using traditional VSync, be it from the game or the control panel has the same effect and gives the cons of using VSync.

 

Using Adaptive VSync is more like a gamble, it may work or it may not work, if it works it may work wrongly (like traditional VSync) or rightfully.

If I enable Adaptive VSync in my Control Panel, enable Triple Buffering and switch Maximum Pre-Rendered Frames to 1, it will work and mostly better than other VSync, I will still have mouse input lag (and it's as good/bad as traditional VSync) but when I reach lower than 60 FPS, VSync is disabled and I don't have that feeling that it runs at 30 FPS, but I do get screen tearing.

Occasional stutters also happen, but not as often as with traditional VSync, on this one I am very sure it's just a placebo effect though, but it's possible that the fact Adaptive VSync is automatically disabled when lower than your refresh rate is what causes that stutter.

 

As a side note worth mentioning, there's also Fast Sync, but I highly discourage it for The Dark Mod unless you play heavily optimized maps, where FPS is never lower than your double (If you have 60, you need 120 FPS, even if it's not counted).

It's pretty much VSync without any feeling that VSync is used, but if your FPS gets lower than 120 (or higher, again his is dependent on refresh rate), even 119 will cause extreme stuttering and mouse input lag.


Edited by The Black Arrow, 05 February 2019 - 05:58 AM.


#15 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 05 February 2019 - 06:15 AM

Right, so Adaptive VSync does indeed solve the half-framerate problem and behave in the way that nbohr suggested, however triple buffering should also solve this (at least with vanilla Doom 3; perhaps something is different in the standalone mod which makes triple buffering behave differently).

 

Therefore I would suggest trying triple buffering first, because it should avoid the half framerate without negating the benefits of vsync (removing tearing). If triple buffering doesn't solve the problem, Adaptive VSync ought to be a solution (if the game does support it).

You can force TB in the driver control panel and it works nicely in TDM (first create a dedicated profile).

BUT it adds a little bit of input latency (not really a problem in stealth-oriented single player games like TDM).


Edited by lowenz, 05 February 2019 - 06:16 AM.

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#16 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 05 February 2019 - 06:21 AM

 

Oh yes, sorry, I should have explained better.

 

By what I mean is that the dreaded "60 to 30 FPS" (I have 60hz, numbers will vary for other refresh rates), the occasional stutters and the mouse input lag happens way more often than usual.

 

Using traditional VSync, be it from the game or the control panel has the same effect and gives the cons of using VSync.

 

Using Adaptive VSync is more like a gamble, it may work or it may not work, if it works it may work wrongly (like traditional VSync) or rightfully.

If I enable Adaptive VSync in my Control Panel, enable Triple Buffering and switch Maximum Pre-Rendered Frames to 1, it will work and mostly better than other VSync, I will still have mouse input lag (and it's as good/bad as traditional VSync) but when I reach lower than 60 FPS, VSync is disabled and I don't have that feeling that it runs at 30 FPS, but I do get screen tearing.

Occasional stutters also happen, but not as often as with traditional VSync, on this one I am very sure it's just a placebo effect though, but it's possible that the fact Adaptive VSync is automatically disabled when lower than your refresh rate is what causes that stutter.

 

As a side note worth mentioning, there's also Fast Sync, but I highly discourage it for The Dark Mod unless you play heavily optimized maps, where FPS is never lower than your double (If you have 60, you need 120 FPS, even if it's not counted).

It's pretty much VSync without any feeling that VSync is used, but if your FPS gets lower than 120 (or higher, again his is dependent on refresh rate), even 119 will cause extreme stuttering and mouse input lag.

Yes but why force TB if you use Adaptive Sync? Or you mean "these are different solutions for the same problem....." ?

There's another recent challenger to monitor Sync management, S-Sync via RTSS: 

 

https://forums.blurb....php?f=2&t=4173

https://forums.guru3...2/#post-5602543

 

Scanline sync is, as far as I'm aware, user controllable tearline steering, which means it isn't technically a form of V-SYNC at all, but a V-SYNC OFF method that mimics the look of traditional V-SYNC, but without the lag.


Edited by lowenz, 05 February 2019 - 06:36 AM.

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#17 OrbWeaver

OrbWeaver

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 7599 posts

Posted 05 February 2019 - 08:43 AM

I guess the real future solution for these issues is FreeSync, but I haven't had the chance to try it out yet. My graphics card does support it, but my monitor doesn't, and I'm not shelling out another 500 quid or more to replace a perfectly decent monitor just to experiment with FreeSync.



#18 The Black Arrow

The Black Arrow

    Member

  • Member
  • PipPip
  • 70 posts

Posted 10 February 2019 - 12:44 PM

Yes but why force TB if you use Adaptive Sync? Or you mean "these are different solutions for the same problem....." ?

There's another recent challenger to monitor Sync management, S-Sync via RTSS: 

 

https://forums.blurb....php?f=2&t=4173

https://forums.guru3...2/#post-5602543

 

Scanline sync is, as far as I'm aware, user controllable tearline steering, which means it isn't technically a form of V-SYNC at all, but a V-SYNC OFF method that mimics the look of traditional V-SYNC, but without the lag.

 

Triple Buffering works for Adaptive VSync too, it's not some fancy thing like Fast Sync after all, it's just VSync but automatically disabled when your frames reach lower than 59 frame, although it takes a small millisecond or two to disabale.

 

S-Sync sounds interesting, but it looks like Nvidia's Fast Sync with another name (the second link mentions it acts almost the same as).

 

I guess the real future solution for these issues is FreeSync, but I haven't had the chance to try it out yet. My graphics card does support it, but my monitor doesn't, and I'm not shelling out another 500 quid or more to replace a perfectly decent monitor just to experiment with FreeSync.

 

It beats G-Sync though, at least AMD don't add their value price upon monitors just because they support FreeSync.



#19 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 10 February 2019 - 01:22 PM

Yes, S-Sync and fast Sync are similar but you get more control over S-Sync thanks to RTSS :)


Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#20 OrbWeaver

OrbWeaver

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 7599 posts

Posted 11 February 2019 - 05:34 AM

It beats G-Sync though, at least AMD don't add their value price upon monitors just because they support FreeSync.

 

Indeed. That and their nonexistent support for open-source drivers are the reasons I won't touch nVidia with a ten-foot pole.



#21 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 11 February 2019 - 08:02 AM

Well, G-Sync works better (and costs more) 'cause it needs some dedicated HW in a certified monitor. FreeSync doens't need it but its performance (in frame-chasing ) is also affected.


Edited by lowenz, 11 February 2019 - 08:02 AM.

Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#22 chakkman

chakkman

    Advanced Member

  • Member
  • PipPipPip
  • 1117 posts

Posted 11 February 2019 - 10:58 AM

Newer Nvidia cards (series 10 upwards) also support FreeSync on top of that. :)



#23 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 11 February 2019 - 12:08 PM

Yes, but the number of FS monitors that passed the internal tests is really low.


Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.


#24 chakkman

chakkman

    Advanced Member

  • Member
  • PipPipPip
  • 1117 posts

Posted 11 February 2019 - 12:13 PM

Ok. Maybe it's a better idea to get a G Sync monitor for Nvidia cards anyway, that way you can be sure.



#25 lowenz

lowenz

    Uber member

  • Member
  • PipPipPipPip
  • 2004 posts

Posted 11 February 2019 - 01:08 PM

Or just take a look to the compatibility list :P


Task is not so much to see what no one has yet seen but to think what nobody has yet thought about that which everybody see. - E.S.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users