Vsync with triple buffering question

Page 4 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

3DVagabond

Lifer
Aug 10, 2009
11,951
204
106
That assumes that your in-game framerate is PERFECTLY matched with your monitor's refresh rate though, right? I.e., enabling Vsync on a 60Hz monitor means that there are 'zero' tears when you have a perfect 60fps...but the reality is that the framerate is not a perfect 60fps unless your rig is powerful enough to guarantee 60fps as the absolute minimum rate in all possible scenarios. Thus in reality, the framerate will sometimes be lower, and when it is, say, in the range of 55-59fps, you get the first type of tearing listed in BrightCandle's post.

It should still remain sync'd. You would have doubled frames. ie; the same image on two refreshes.
 

Deders

Platinum Member
Oct 14, 2012
2,401
1
91
That assumes that your in-game framerate is PERFECTLY matched with your monitor's refresh rate though, right? I.e., enabling Vsync on a 60Hz monitor means that there are 'zero' tears when you have a perfect 60fps...but the reality is that the framerate is not a perfect 60fps unless your rig is powerful enough to guarantee 60fps as the absolute minimum rate in all possible scenarios. Thus in reality, the framerate will sometimes be lower, and when it is, say, in the range of 55-59fps, you get the first type of tearing listed in BrightCandle's post.

I don't get any tearing whatsoever when I use normal Vsync, but i do sometimes with the newer adaptive modes, which is why I stick to the old Vsync and Triple buffering which I have to enable through D3Doverider as the nvidia CPL doesn't always enable it in every game.

Funny thing is it did when I had my SLI setup but since switching to a single card It doesn't seem to have much effect.
 

Black Octagon

Golden Member
Dec 10, 2012
1,410
2
81
Ok thanks. Well as I said I still don't seem to notice tearing, regardless of whether vsync or any other frame limiter technology is enabled. Latency, on the other hand, I strive to minimise, so I run a 120Hz monitor and adjust in-game settings as much as necessary to guarantee framerates in the region of 90-120fps
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
If Vsync is on there are never any tear lines. Instead the frame waits until the beginning of the cycle before it outputs the frame. So it delays it instead of drawing partially over the previous frame. This causes some perceived latency and can be up to 16ms extra time before the pixels start appearing, but the entire frame will appear instead of getting 2 frames with an apparent tear at the point where it switched. Which is why I say the trade off is latency verses image quality.

Triple buffering is more complicated. The way DirectX is implemented there is no official triple buffering and I am not convinced that DXOverrider does what people claim it does. The DirectX API doesn't support setting the policy and the buffering of triple buffering so its largely simulating it using the pieces available. From my testing and research I don't think its doing true triple buffering, I think its just smoothing the output with a third buffer but without the policy that allows them to swap, so while the GPU always has a buffer to write to its the same one not a choice of two. That will help but it also universally is going to add another 16ms of latency on top of the 16ms from the vsync and for marginal gains in smoothing out the output.
 

PrincessFrosty

Platinum Member
Feb 13, 2008
2,301
68
91
www.frostyhacks.blogspot.com
Triple buffering is supposed to help a wee bit with mouse lag as well.

it does help a bit, triple buffering will attempt to prepare the next frame, if it finishes rendering the next frame while the current refresh is still happening it will attempt to draw a 2nd, newer frame before the refresh finishes, and so on, whatever the newest whole frame is will be the one that gets displayed, in some cases, especially those with high frame rates you get less lag than standard double buffered vsync.

It's openGL only unless you use a 3rd party app to fake it, or a game internally implements it, the Direct3D standard doesn't include triple buffering.

That assumes that your in-game framerate is PERFECTLY matched with your monitor's refresh rate though, right? I.e., enabling Vsync on a 60Hz monitor means that there are 'zero' tears when you have a perfect 60fps...but the reality is that the framerate is not a perfect 60fps unless your rig is powerful enough to guarantee 60fps as the absolute minimum rate in all possible scenarios. Thus in reality, the framerate will sometimes be lower, and when it is, say, in the range of 55-59fps, you get the first type of tearing listed in BrightCandle's post.

The behaviour of vsync is that if your video card cannot produce another whole frame in time for the next refresh, it forces the current frame to render again, which leads to essentially having your frame rate capped at 60fps, if you cannot manage 60fps then it will drop to 1/2 that because each frame gets doubled, that's 30fps, if you can't manage 30fps it will triple each frame to 1/3 the frame rate of 20fps, etc.

Brigthcandles post refers to different types of tearing, they're not really different types of tearing, it's just tearing happening for the same fundamental reasons but at different rates, refer to my earlier posts to get a good explanation of why tearing frequency changes with frame rate, that's really what he's refering to.

So no different "types" of tearing, and no different causes for those types. There is just 1 type of tearing and it happens to a greater or less degree which depends on the ratio of your frame rate compared to your refresh rate.

frame rate/refresh rate = average tears per refresh.
 

Deders

Platinum Member
Oct 14, 2012
2,401
1
91
....... That will help but it also universally is going to add another 16ms of latency on top of the 16ms from the vsync and for marginal gains in smoothing out the output.

My entire frametime is 16ms at 60fps (& 60Hz), obviously it gets higher if the framerate drops.

Interesting that DirectX doesn't support it natively, it used to work fine when I had my SLI setup. Why wouldn't D3DOverrider be able to select which frame to put on the screen? Surely this defeats the object of having a third buffer in the memory?
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
My entire frametime is 16ms at 60fps (& 60Hz), obviously it gets higher if the framerate drops.

Interesting that DirectX doesn't support it natively, it used to work fine when I had my SLI setup. Why wouldn't D3DOverrider be able to select which frame to put on the screen? Surely this defeats the object of having a third buffer in the memory?

Microsoft never added support for it. Mostly because the increased latency is highly noticeable to the grand majority of people and thus is problematic. But its definitely not real triple buffering in DX and DXOverrider can not fix it because it doesn't get to choose which buffer is switched to the screen, it can only set up 3 buffers and their order not the policy on which they are swapped. Just a limitation of the API itself.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
Tearing happens at all frame rates, this is just a FACT.

For a CRT you can actually calculate the likely average tear lines you'll see, the screen spends approx 95% of the time scanning and 5% of the time moving the electron gun back to the top of the screen, but for easy maths lets say that 100% of the time is spent refreshing, it just makes the concept of tear-scaling easier to grasp.

If you have a frame rate of 60fps and a refresh of 60hz, but it's not in perfect sync (vsync off) then the border between frames will always be somewhere inside your current refresh, so basically at 60fps@60hz you get 1 tear line per refresh or 60 tears per second.

If you have a frame rate higher than your refresh rate, say 120fps@60hz then you've got 120/60=2 frames for every refresh, which means you're likely to see 2 tear lines per refresh.

If you have a frame rate lower than your refresh rate say 30fps@60 then you've got 30/60=0.5 tears per refresh. What does this mean, well you don't have half a tear per frame you have 1 full tear per 2 frames.

Expressed in it's basic form, the number of tears per second you can expect to see is the frame rate you're running at divided by your refresh rate, frame rate is the numerator which means as it goes up the tearing goes up, refresh rate is the denominator which means as the refresh rate goes up the tearing (per refresh) goes down.

Now I said this is effectively for CRTs because they have a known scan time of about 95% of the total refresh period, however I'm not sure how fast LCDs are...do they take most of the refresh period to scan down the pixels, or is that time much smaller? I'm not actually sure it's hard to find numbers on and may differ from model to model.

The smaller that refresh window is the less impact tearing has, if you're at 60hz for example that's 16.6ms per refresh, but it could be that it only takes the LCD 8ms to scan from top to bottom in which case you'd expect on average to see about half the tearing compared to CRT.

But no matter what that window is (because it's constant) it still means that tearing scales linearly with frame rate, the higher the frame rate the more frequently you tear.

Like I said, I understand that, as Black Octagon pointed out.

I was pointing out that there are a lot of users who don't and seemed to think there isn't any tearing below your refresh rate. This leads me to believe that for a lot of people, tearing at FPS below your refresh rate doesn't seem to bother them.
 

Deders

Platinum Member
Oct 14, 2012
2,401
1
91
Microsoft never added support for it. Mostly because the increased latency is highly noticeable to the grand majority of people and thus is problematic. But its definitely not real triple buffering in DX and DXOverrider can not fix it because it doesn't get to choose which buffer is switched to the screen, it can only set up 3 buffers and their order not the policy on which they are swapped. Just a limitation of the API itself.

It must be able to choose like double buffering does, and then just choose the next screen when it's complete, otherwise it wouldn't display the screens in the correct order and you'd notice .
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
Microsoft never added support for it. Mostly because the increased latency is highly noticeable to the grand majority of people and thus is problematic. But its definitely not real triple buffering in DX and DXOverrider can not fix it because it doesn't get to choose which buffer is switched to the screen, it can only set up 3 buffers and their order not the policy on which they are swapped. Just a limitation of the API itself.

DirectX does have official supported triple buffering, but it has an additional rule, which is why some people like to pretend it is not real.

DirectX's version of triple buffering does not allow a new frame to be rendered if both back buffers have complete images. It'll wait until one is displayed and removed before it allows you to start rendering a new frame.

This method makes things just as smooth as the OpenGL version, but in cases where your FPS are much higher than your refresh rate, it can add latency, if there was enough time to render multiple frames before a refresh takes place, but the down side is your GPU must work harder and get hotter.
 
Last edited:

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
DirectX does have official supported triple buffering, but it has an additional rule, which is why some people like to pretend it is not real.

DirectX's version of triple buffering does not allow a new frame to be rendered if both back buffers have complete images. It'll wait until one is displayed and removed before it allows you to start rendering a new frame.

This method makes things just as smooth as the OpenGL version, but in cases where your FPS are much higher than your refresh rate, it can add latency, if there was enough time to render multiple frames before a refresh takes place, but the down side is your GPU must work harder and get hotter.

I would call the DirectX version three buffers not triple buffering. Its just an additional back buffer in front of the vsync one. As far as I know it can overwrite the first back buffer as often as it wants to (which is how it gets greater than 60fps) but it can only ever write to that back buffer, and the other one in between must always be used. Thus the latency is increased and the full benefits of using three back buffers is not realised. Triple buffering the real technique is vastly superior in every way, it has less latency and allows for better performance above vsync refresh rates.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
It is triple buffering by definition. That is what they call it. It just isn't the same as OpenGl's version. It also seems to be on by default for most games, if you use v-sync.

EDIT: Triple buffering doesn't use 3 back buffers. It has no reason to. It has 2 back buffers and a front buffer (if you have more, it is 4 buffers or more). You only have to save the most recent back buffer and write to the other. DirectX's version doesn't let you do that, and you are right, it adds a frame of latency as a result. This isn't good for me, but it is what it is. They call it triple buffering, so I don't see how you can say it isn't. It just isn't OpenGl's implementation of it.
 
Last edited:

Deders

Platinum Member
Oct 14, 2012
2,401
1
91
but the down side is your GPU must work harder and get hotter.

Just tested with Metro: Last light benchmark, Vsync and Triple buffering off, then both on with D3DOverrider. Framerate and temperatures were the same. 62c max.
 

futurefields

Diamond Member
Jun 2, 2012
6,471
32
91
I don't really seem to have issue with this "micro-stutter" using triple buffering, ill have to check closer. I run my games @ 60, 48, or 36 fps depending on the game. Crysis 3 for example is one I run at 36, so I can enable higher quality fx, and the motion blur makes 36 fps in that game feel pretty smooth. Crysis 2 I run at 48 fps because I wasnt quite able to maintain 60 fps @ ultra settings, locking it to 48 feels very playable.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
Just tested with Metro: Last light benchmark, Vsync and Triple buffering off, then both on with D3DOverrider. Framerate and temperatures were the same. 62c max.

That is what you'd expect when the FPS is the same.

The difference is with OpenGL is that it can allow your FPS to be much higher than your refresh rate, even with v-sync on, unlike DirectX. The high frame rate, will cause higher temperatures.
 

Deders

Platinum Member
Oct 14, 2012
2,401
1
91
Ahh I see, I thought you meant in DirectX when comparing hardware triple buffering and D3DOverrider's version.

It does leave me wondering though how Vsync would work with higher FPS than it's synced to.... I seem to remember having to remove Vsync to get more than 85fps with my old CRT in OpenGL.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
Ahh I see, I thought you meant in DirectX when comparing hardware triple buffering and D3DOverrider's version.

It does leave me wondering though how Vsync would work with higher FPS than it's synced to.... I seem to remember having to remove Vsync to get more than 85fps with my old CRT in OpenGL.

I personally do not recall, but BrightCandle has brought it up numerous times. He is saying, and I have no reason to doubt him, that triple-buffering does not stop switching buffers after it finishes rendering one, even if both back buffers are filled. Wikipedia agrees with this behavior.

What happens is when vertical blanking mode comes around, and the video card can then flip a back buffer to the front buffer, it will flip the most recent completed frame. This behavior will minimize latency in two ways; 1) by allowing the GPU the opportunity to attempt to make a more current frame, even though the back buffers are filled and waiting and 2) it doesn't have to display every frame created, so it can skip ahead to the most recent completed frame.
 

brag.yondide

Junior Member
Jul 8, 2013
14
0
66
I would call the DirectX version three buffers not triple buffering. Its just an additional back buffer in front of the vsync one. As far as I know it can overwrite the first back buffer as often as it wants to (which is how it gets greater than 60fps) but it can only ever write to that back buffer, and the other one in between must always be used. Thus the latency is increased and the full benefits of using three back buffers is not realised. Triple buffering the real technique is vastly superior in every way, it has less latency and allows for better performance above vsync refresh rates.
Wikipedia http://en.wikipedia.org/wiki/Multiple_buffering says this:
Another method of triple buffering involves synchronizing with the monitor frame rate. Drawing is not done if both back buffers contain finished images that have not been displayed yet. This avoids wasting CPU drawing undisplayed images and also results in a more constant frame rate (smoother movement of moving objects), but with increased latency.[1] This is the case when using triple buffering in DirectX, where a chain of 3 buffers are rendered and always displayed.
BTW the note [1] refers to AnandTech's article on triple buffering.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |