PDA

View Full Version : triple buffering



aperson
08-17-2012, 02:32 AM
How would I implement triple buffering? (https://en.wikipedia.org/wiki/Multiple_buffering#Triple_buffering)
From a bit of searching, I know that a framebuffer object can be used for a buffer.

Triple buffering implies that one back buffer is always being rendered to, and the other back buffer is done rendering.

I imagine (at least part of) the code looks something like:


while true
render to bufferA
swap bufferA and bufferB


How does the swap with the front buffer happen? If you look at https://en.wikipedia.org/wiki/File:Comparison_double_triple_buffering.svg , the copying (i.e. swap with front) happens at the same time asthe rendering. Is multithreading required?

V-man
08-17-2012, 04:55 AM
I think it is best to leave that to the hardware. http://www.opengl.org/wiki/Common_Mistakes#Triple_Buffering
The user can enable it through the control panel (nvidia or amd)

aperson
08-18-2012, 12:01 AM
I think it is best to leave that to the hardware. http://www.opengl.org/wiki/Common_Mistakes#Triple_Buffering
The user can enable it through the control panel (nvidia or amd)

If it is enabled, what would a program that takes advantage of triple buffering roughly look like?

If it is not enabled, how would one implement it using FBO's?