DerekWilson
Platinum Member
- Feb 10, 2003
- 2,920
- 34
- 81
So ... here's the deal ...
A programmer can do what ever they want with the buffers they are given.
That said, it would be very unwise to do anything different than what TheSnowman suggests.
Also, if you look at it in this light, triple buffering is not useful without vsync ... there's no need to render to a third buffer when you can just flip every time your back buffer fills up.
If I were doing triple buffering, I would bounce back and forth between the two back buffers constantly rendering the scene in its current state. When one frame was done rendering I'd overwrite the next. As soon as we hit vblank, I'd swap in the most recently finished frame.
This does NOT create a situation where movement is jerky like BFG suggests.
It isn't "dropping frames" in the sense that we think of for video playback -- these frames never needed to be displayed becaues they represented the state of the game at an earlier time than the frame flip happened. Displaying only the most recently completed frame delivers the most current image that reflects the state of the game at a time nearest to the time it is seen by the users eyes.
In other words, if we do what TheSnowman suggest, the front buffer (what the gamer sees) will always be the nearest reflection of the state of the game.
If we have a game that renderes REALLY quickly (say inifinity frames per second) here's what we get --
double-buffered + novsync = infinity FPS with no input lag and probably lots of tearing
double-buffered + vsync = 60fps with 1/60 seconds input lag -- the next frame is finished rendering with the input state that existed as soon as the frame was flipped -- it must wait a full 1/60 seconds to display the updated frame. from a page flipping perspective this is the scenario that has the potential to cause the most input lag.
triple-buffered (vsync implied) = 60 fps with zero input lag
...
i'm sure a programmer could implement it in a different way. it might be that forcing triple-buffering from a driver causes problems with input lag depending on how the driver interprets what the game wants to do. it could be that some game designers were trying to use triple buffering to render complex multi-frame effects using both back buffers to render one frame.
this really would defeat the purpose of triple buffering ... it would be unwise to stall rendering and not overwrite the old buffer.
A programmer can do what ever they want with the buffers they are given.
That said, it would be very unwise to do anything different than what TheSnowman suggests.
Also, if you look at it in this light, triple buffering is not useful without vsync ... there's no need to render to a third buffer when you can just flip every time your back buffer fills up.
If I were doing triple buffering, I would bounce back and forth between the two back buffers constantly rendering the scene in its current state. When one frame was done rendering I'd overwrite the next. As soon as we hit vblank, I'd swap in the most recently finished frame.
This does NOT create a situation where movement is jerky like BFG suggests.
It isn't "dropping frames" in the sense that we think of for video playback -- these frames never needed to be displayed becaues they represented the state of the game at an earlier time than the frame flip happened. Displaying only the most recently completed frame delivers the most current image that reflects the state of the game at a time nearest to the time it is seen by the users eyes.
In other words, if we do what TheSnowman suggest, the front buffer (what the gamer sees) will always be the nearest reflection of the state of the game.
If we have a game that renderes REALLY quickly (say inifinity frames per second) here's what we get --
double-buffered + novsync = infinity FPS with no input lag and probably lots of tearing
double-buffered + vsync = 60fps with 1/60 seconds input lag -- the next frame is finished rendering with the input state that existed as soon as the frame was flipped -- it must wait a full 1/60 seconds to display the updated frame. from a page flipping perspective this is the scenario that has the potential to cause the most input lag.
triple-buffered (vsync implied) = 60 fps with zero input lag
...
i'm sure a programmer could implement it in a different way. it might be that forcing triple-buffering from a driver causes problems with input lag depending on how the driver interprets what the game wants to do. it could be that some game designers were trying to use triple buffering to render complex multi-frame effects using both back buffers to render one frame.
Furthermore if you get to the state where both buffers are full and there's still no refresh cycle then a triple buffering system will stall just like a double buffered one.
this really would defeat the purpose of triple buffering ... it would be unwise to stall rendering and not overwrite the old buffer.