What is triplebuffering and what it does?
Is it the next to singlebuffering and doublebuffering? And can it be used in OPENGL?

Hi !

It is what it sounds like, 3 buffers instead of 2, some times this is used because it allows you to draw to the third buffer whilke the first is displayed and the second is waiting to be displayed.

Some OpenGL cards can do this but I don’t know if it’s something you can control from your side.


Isn’t double buffering is more than enough?

Double buffering has some drawback. Say you have v-sync enabled and your monitor is running at 80Hz. If your program can’t render a frame in less than 1/80 of a second, you get some problems. If you start drawing a frame at the same time the monitor does a vertical retrace. If you aren’t finished drawing when the next vertical retrace occurs, the program must wait for another vertical retrace, wasting lots of processing time. This means you must wait for two retraces each frame, giving you a framerate of about 40 fps. If you use a third buffer, you can start drawing another frame immediately, instead of waiting.

If you run at 80Hz, and take 1/79 of a second to render a frame, your program will be stalled for almost 50% of the CPU time. This is because you finish the frame just after the retrace. You draw slightly more than one retrace, and wait for slightly less than one retrace. If you instead use tripple buffering, you can start draw immediately. This way, you will only miss a frame efery 80th frame, instead of every second, wasting only about 1.2% of the CPU time.

Oh! I see. But is it commonly used. I mean up till now everything seem to be only double buffering.

There’s not way to do tripple buffering in OpenGL, so double buffering is all you got to choose from (not counting single buffering as a choise for gaming).


If we go for triple buffering is that means we can increase the fps rate ?

How many no of buffers we could go for to get a good fps rate ?

I wouldn’t say you increase the framerate. It rather “prevents” sudden drops in framerate due to high rendering time with respect to the vertical retrace.

But more buffers is not the solution to all problems. It gives you some aswell. A double buffer has two frame buffers, tripple buffers has three frame buffers, and so on. When going higher and higher in resolution and color depth, your video memory disappears quite fast.

More buffers also decreases the response time in your application (that is, from user input to result on the screen). In tripple buffering, you have two complete frames that not yet has been shown. When the framerate goes down, I can imagine this can be notable in fast FPSs like Quake, UT.

And as I said, I’m not even sure you can to anything other than single and double buffering in OpenGL.

i think that triple buffering is done by the video card drivers. so, you ask for a double buffered drawable, and if the user has triplebuffering enabled, you really get a triple buffered windo, but its transparent to the programer (you just call the swap buffers routine, and it takes care of the rest)

dont quote me on this though…