Jump to content

  • Log In with Google      Sign In   
  • Create Account

Triple Buffering In OpenGL?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
22 replies to this topic

#1 mavric   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 July 2002 - 09:23 AM

Hi Could someone please tell me how to do triple buffering in OpenGL? Thanks

Sponsor:

#2 outRider   Members   -  Reputation: 852

Like
Likes
Like

Posted 06 July 2002 - 02:23 PM

The driver controls that. I don''t think there''s a way to affect that through your application''s code. I don''t know how the driver makes such a determination though...

------------
- outRider -

#3 Buzzy   Members   -  Reputation: 305

Like
Likes
Like

Posted 06 July 2002 - 06:36 PM

No, you should be able to do triple buffering, but why on earth would you want to? There''s no need for any more than double buffering...

--Buzzy
(formerly buzzy_b)

#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 06 July 2002 - 07:10 PM

Triple buffering allows you to keep drawing while the first image is being displayed and the second waits for its turn. Rather than remain idle waiting for the buffer swap to occur you use the extra time to draw an additional frame.

#5 Buzzy   Members   -  Reputation: 305

Like
Likes
Like

Posted 06 July 2002 - 07:22 PM

Thank you AP, but I know what triple buffering is .

[Edit] I said something stupid, imo. Ignore this...

--Buzzy
(formerly buzzy_b)

[edited by - Buzzy on July 10, 2002 1:14:41 AM]

#6 TangentZ   Members   -  Reputation: 403

Like
Likes
Like

Posted 07 July 2002 - 03:19 AM

quote:
Original post by Anonymous Poster
Triple buffering allows you to keep drawing while the first image is being displayed and the second waits for its turn. Rather than remain idle waiting for the buffer swap to occur you use the extra time to draw an additional frame.



I disagree. Double-buffering is more than enough for smooth
animation. Why would you want to "idle"? Right, you wouldn''t.
You''d use all the CPU power that you get.

If it took 5 ms to render the last screen, great, start
working on the next screen by rendering to the back buffer
and swap. No "idle" there. We''re talking 200 fps.

Maybe you''re thinking "wait for vertical sync" but that''s
just silly. Surely, you''ve already turned *OFF* vertical sync?

Kami no Itte ga ore ni zettai naru!

#7 phantom   Moderators   -  Reputation: 7593

Like
Likes
Like

Posted 07 July 2002 - 03:24 AM

also, triple buffering means you have a 3rd chunk of vid. ram being taken up for screen display, bit of a waste when double buffering is enuff.

#8 Chrominium   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 July 2002 - 04:03 PM

All Mavric ask is how to do triple buffering in OpenGL not for opinions whether to use it or not. I''m sure he has his reasons. It might be good pratice for the future...

Any, I don''t have the answer and would like to find out. You can do it easily in Directx so I don''t think its a driver issue but what do I know?

#9 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 07 July 2002 - 04:25 PM

If I''m not mistaken, you can enable triple buffering in the "video card driver settings" of Windows of some video cards (I''m not going to boot Windows to check, feel free to do so yourself ). I don''t know how (or if) you can from your code though, as I''ve never wanted to.



#10 TangentZ   Members   -  Reputation: 403

Like
Likes
Like

Posted 07 July 2002 - 06:07 PM

quote:
Original post by AndyTang
All Mavric ask is how to do triple buffering in OpenGL not for opinions whether to use it or not. I''m sure he has his reasons. It might be good pratice for the future...



If a person is standing at the edge of a high cliff and
ask "How do I do a backflip?", do you simply tell him to
raise his hands and jump backwards, or do you tell him to
step forward and walk away from the cliff?

Something to think about...


~~~~
Kami no Itte ga ore ni zettai naru!

#11 uNiQue0815   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 July 2002 - 09:49 AM

if i were the person standing at the cliff, wanting to do the backflip (maybe it''s the thing i''ve always been dreaming about...), i would rather hear the answer on my question, than something like "good advice" not to do it .

so i think, i would appreciate having my question answered & not being told what anyone else thinks about it...

[i also HATE being told what someone else thinks about what i want to do, when the only thing i wanted was an answer on my question...

one example (little bit off-topic ) :
i wanted to exchange the red LED in my optical mouse with a blue LED. so i mailed to my optical mouse''s manufacturer, how i can open the mouse (didn''t see any screws) and if the sensor would work correctly on blue light, too...
ALL I WANTED WAS AN ANSWER TO WHAT I ASKED !
the answer i got was :
"if you open your mouse, you''ll void your guarantee !"
WAS THAT THE ANSWER TO MY QUESTION ?! don''t think so...
boy... this day i wanted to CRUSH THIS MAN''S HEAD !!!
how i hate this !
]

just something to think about...

#12 Sneftel   Senior Moderators   -  Reputation: 1781

Like
Likes
Like

Posted 08 July 2002 - 09:55 AM

Triple-buffering is useful when certain isolated frames may take considerably longer to draw than most others. For instance, when a block of new textures is loaded in. Basically, you have an extra frame of safety, which can be drawn to maintain the framerate even when your renderer takes twice as long to draw the new frame.

Max Payne makes good use of triple buffering; it makes gameplay a lot smoother, especially on cards that aren't bleeding-edge. (Or, rather, weren't when it came out).

Triple buffering also makes v-sync blocking make much more sense. If you can guarantee an exact framerate for 99.9999% of frames, you won't get the problems that newbie game developers so often complain about that are caused by v-sync remaining on.

For instance, let's suppose you have a refresh rate of 72 Hz. Most of your frames take 1/80 of a second to draw. Double buffering is fine, even when vsync is enabled.

Now let's suppose that one frame takes 1/60 of a second. Uh oh... the buffer isn't ready for the v-sync, so there's an entire 72nd of a frame where action freezes. It doesn't matter that the engine could catch up later; you've already got a problem.

With triple buffering, however, you'd smoothly suck up that extra pre-rendered frame. By then, you'd have a new frame to show. You'd spend a few seconds catching up to your third buffer, but you'd get the advantages of v-sync without the disadvantages.

[edited by - sneftel on July 8, 2002 5:01:29 PM]

#13 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 08 July 2002 - 08:27 PM

quote:
Original post by Buzzy
Thank you AP, but I know what triple buffering is . But with modern cards, its not needed. Right now, the major bottleneck is fillrate. What that means is that the video card is taking more time to draw the current frame than its taking the program to get the next frame read. Triple buffering would just mean that you''d have 2 frames waiting to be drawn, instead of just the one.


I don''t see how a fill-rate bottleneck makes triple buffering irrelevant. Assume vsync is enabled and the front buffer is locked during display. If the refresh rate is 1/60 and the card/engine combo draws at a constant rate of one frame every 1 + 1/60 seconds, double buffering will give you a frame rate of 1/30 while triple buffering will give you a frame rate of nearly 1/60. That''s because with triple buffering the card doesn''t sit idle while waiting for the vertical retrace, so it has time to draw some extra pixels for slack.

#14 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 08 July 2002 - 09:44 PM

Ooops! Instead of one frame every 1 + 1/60 seconds, make that one frame every 1/60 + 1/A seconds, where A is some constant larger than 60. The extra time is to account for rendering that takes multiple passes for each frame.

#15 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 09 July 2002 - 05:56 AM

that would suck if you could only get 60 fps.

#16 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 09 July 2002 - 05:56 AM

that would suck if you could only get 60 fps.

#17 Chrominium   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 July 2002 - 06:56 AM

haha, thanx everyone for answering anyway...

back to the topic, does anyone know how to do triple buffering or is it impossible to do in the current version of opengl?

#18 Crazy_Vasey   Members   -  Reputation: 100

Like
Likes
Like

Posted 09 July 2002 - 10:43 AM

Can you request it in the pixel format?

#19 Chrominium   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 July 2002 - 10:53 AM

I know DOUBLE_BUFFERING can be specified, no mention of triple buffering in the manual but I have the old documention version 1.1 from the MSDN library.

Maybe for the newer version of Opengl - 1.2/1.3?

#20 phantom   Moderators   -  Reputation: 7593

Like
Likes
Like

Posted 09 July 2002 - 10:56 AM

how is it turned on in DX?
if its a function call then i assume it would have to be an OGL extension to enable it
if its a pixel format flag then check for that pixel format and request it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS