Triple buffering

Started by
5 comments, last by Zook 21 years ago
Can''t seem to get triple buffering to work. I have set the backbuffercount to 2, but the framerate still jumps between refreshrate and refreshrate/2. Is there something more that should be done?
Advertisement
TRIPLE BUFFERING means that whatever you show on the screen will be drawn 3 times before it shows up on the monitor. Forget about triple buffering - it only slows down the app.

triple-buffering is sometimes useful, but it won''t speed up your overall framerate if you can''t feed frames into the buffer fast enough.

How appropriate. You fight like a cow.
Check the code that you are using to do the actual flip - it is possible to explicitly say which surface you want to flip from, and if you are accidentally doing this for, you might be always flipping between the same 2 surfaces leaving your third buffer unused.

quote:triple-buffering is sometimes useful, but it won''t speed up your overall framerate if you can''t feed frames into the buffer fast enough.


It sounds like it would be useful here, since the framerate is stuck on harmonics of the refresh rate.

quote:TRIPLE BUFFERING means that whatever you show on the screen will be drawn 3 times before it shows up on the monitor. Forget about triple buffering - it only slows down the app.

What are your reflex speeds? Long enough that being one (or 2) frames behind isn''t going to matter. Your mind is very good at adjusting to stuff where feedback is delayed, but it works best if feedback is delayed by a constant amount - thus triple buffering will help as the framerate will be constant (hopefully).

Trying is the first step towards failure.
Trying is the first step towards failure.
Actually, triple buffering sometimes will help.

The blitter doesn''t do anything if it''s waiting for the vertical refresh during flips. This waste can be eliminated if there is a third buffer. While the flip is waiting to be done, the blitter can continue to blit onto the third buffer. This will increase your frame rates.

Preferably you should let the user chose if s/he wants to triple buffer or not. Triple buffering would work very differently on different machines. Some machines might have a fast refresh rate but you app wont be able to draw th scene threee times fast enough. while others might be able to draw 3 times very fast and then have to wait for the vertical retrace thingy. Triple buffering would most of the time slow the app down becuase of having to draw the sme thing over 3 times and haveing to also flip extra times.

I guess you''ll have to experiment a lot with it

:::: [ Triple Buffer V2.0 ] ::::
[size=2]aliak.net
You don''t draw the same thing several times, but what you draw this frame won''t be displayed until two frames later instead of the next frame, and you still only flip once per frame. One disadvantage is of course that you loose some vid mem. Anyway, it works fine now after I switched from D3DSWAPEFFECT_DISCARD to D3DSWAPEFFECT_FLIP.

This topic is closed to new replies.

Advertisement