• Advertisement

Archived

This topic is now archived and is closed to further replies.

tripple buffering

This topic is 5264 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi i know what double (frame-)buffering is, but i can''t image what tripple buffering is supposed to be... someone knows? is it just one more buffer so you have always one untouched buffer (one beeing drawn and one beeing computed)? if so what does that serve?

Share this post


Link to post
Share on other sites
Advertisement
Triple buffering allows the card to render things slightly behind what the processor is doing. That is, your game could be on one frame but your video card is still busy rendering the last frame. This can sometimes speed things up quite a bit, but it also uses more memory.

Share this post


Link to post
Share on other sites
Wouldnt this also introduce some visual lag between the players actions and what he sees at lowish framerates? Or is 2 frames late even noticeable?

Waramp.

"Before you insult a man, walk a mile in his shoes.
That way, when you do insult him, you''ll be a mile away, and you''ll have his shoes."

Share this post


Link to post
Share on other sites
It''s not really a noticeable lag. It can make motion smoother when your engine tends to have a few individual frames that take significantly longer to render than most, simply because you have another cached frame you can ''use up'' before the screen freezes.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
To answer your question:

Triple buffering will speed up rendering for the situation where your frame rate is slower than the monitor refresh rate and you only flip pages during vblank.

Here is an example of the problem:

Suppose the refresh rate is 100 Hz (or 10 ms/refresh) and it takes 11 ms to render the frame. Since you can only do a page flip during vblank, you flip every 20 ms (every other frame). That means that after you are done drawing, you have to wait 9 ms for the new draw buffer to become available.

With triple-buffering, you start drawing immediately into a third buffer, instead of waiting for the second buffer.

Here is a comparison using the above example. The buffers are A, B, and C.
Time(ms) Double-buffering                  Triple-buffering
-------- ---------------- ----------------
0 draw A 10ms draw A 10ms
10 draw A 1ms, wait 9ms, display A draw A 1ms, draw B 9ms, display A
20 draw B 10ms draw B 2ms, draw C 8ms, display B
30 draw B 1ms, wait 9ms, display B draw C 3ms, draw A 7ms, display C
40 draw A 10ms draw A 4ms, draw B 6ms, display A
50 draw A 1ms, wait 9ms, display A draw B 5ms, draw C 5ms, display B
60 draw B 10ms draw C 6ms, draw A 4ms, display C
70 draw B 1ms, wait 9ms, display B draw A 7ms, draw B 3ms, display A
80 draw A 10ms draw B 8ms, draw C 2ms, display B
90 draw A 1ms, wait 9ms, display A draw C 9ms, draw A 1ms, display C
100 draw B 10ms draw A 10ms, display A

As you can see, the double-buffered frame rate is 50 fps (5.5 frames in 110 ms) and the triple-buffered frame rate is 91 fps (10 frames in 110 ms). The benefit of triple-buffering depends on how long it takes to render a frame and how much time is wasted waiting for vblank.

Share this post


Link to post
Share on other sites
Sorry for interupting, but is there a way to setup trible buffering in OpenGL???

HellRaiZer

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
it''s gonna come with sdl 1.3

Share this post


Link to post
Share on other sites
Thanks for the tip, but i''m not interested for SDL! (If the post was for me AP!!!).

I want to know if it is availiable to custom OpenGL applications.

HellRaiZer

Share this post


Link to post
Share on other sites
AP: SDL has nothing to do with triple buffer support for OpenGL, that is entirely an os/driver issue. I suggest reading the system API docs for whatever platform you are using for how to set up triple buffering if available.

____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

Share this post


Link to post
Share on other sites
simple said, it makes rendering as fast as possible possible, just like when you disable vsync. but at the same time, you can still have vsync.

so no tearing, and fullspeed rendering. and full time 100% gpu and cpu usage.

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Any hints on how to setup it, on OpenGL??? With API docs, it isn''t that clear for OpenGL!! I''ll try nVidia''s site to see what i can find.

HellRaiZer

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
what exactly is tearing?

Share this post


Link to post
Share on other sites
quote:
Original post by davepermen
simple said, it makes rendering as fast as possible possible, just like when you disable vsync. but at the same time, you can still have vsync.

so no tearing, and fullspeed rendering. and full time 100% gpu and cpu usage.

"take a look around" - limp bizkit
www.google.com


Actually, that is not entirely true. You will still be bound by the number of backbuffer you have at your disposal. If you are doing some heavy work and rarley fills the third buffer until it swaps for the next one then yes it will be full speed ahead.
But, if you are not doing heavy work and you are sitting on some powerful hardware you will still be waiting.

As for tearing:

Tearing is what happens when you see an image and a new one appears before the whole image is displayed.

Imagine a circle on a screen moving rightwards while the screen is being drawn.

./.\

.\./- no tear while moving right.


../.\

.\./.- tear while moving right.



[edited by - MichaelT on August 22, 2003 5:07:03 PM]

Share this post


Link to post
Share on other sites
Whenever the ARB decides that tripple-buffering is needed,tripple-buffering will be added!

"Tonight we strike,there is thunder in the sky,together we''ll fight,some of us will die,but they''ll always remember that we''ve made a stand and many will die by hand!" - ManOwaR

Share this post


Link to post
Share on other sites

  • Advertisement