Re: double buffering



On Sat, 25 Jun 2005 22:28:15 -0700, "vsgdp" <spam@xxxxxxxxxx> wrote:
>I have read two reasons for double buffering:
>
>1. To prevent updating the memory the monitor is drawing from while it is in
>the middle of drawing a frame.
>
>2. To prevent flicker from overdraw.
>
>Most information I have found gives one reason but not the other. Which is
>it and has one become outdated?

If you're learning about double buffering, you might also want to look
at triple buffering.

<http://www.intel.com/support/graphics/sb/CS-004527.htm>

Both reasons for double buffering can be meaningful, but the first has
two aspects. Once upon a time, not so long ago, we did not have frame
buffers because memory was expensive and slow. The rate at which video
signals sucked out even 1-bit pixels exceeded what RAM could provide.
One clever solution was a special RAM design that clocked out the bits
sequentially, rather than going through the usual random addressing
logic. Even so, writing while reading was proceeding did not work too
well. Today, RAM is much cheaper and faster, and read-write conflicts
are less of an issue for access time.

However, a logical problem remains. If we draw into an image as it is
being sequentially displayed, we can easily display part of the old
image along with part of the new image. The visual effect can be ugly.
We prefer to preserve the integrity of each frame, to draw it as a
whole and to display that whole. Multiple buffers help us do that.

The story does not end there, because we lose something as well. To
accelerate the flow of graphics through the rendering to the screen,
we not only use multiple buffers, we also heavily use pipelining. The
idea is, again, that while one part of the system is doing one thing
another part can be doing something different. This does give us high
speed, but it also introduces latency. The problem can be especially
severe with a head-mounted display. Our vestibulo-ocular system has
evolved to give tight coordination between our head movements and our
visual perception. A HMD is not so evolved. The head moves, a sensor
detects and measures, data is sent to the CPU, the graphics program
responds, a new frame is rendered, and finally the eyes see the new
display. This is an enormous amount of latency, far more than a human
brain will gracefully accept.

As a vivid analogy, imagine that while driving a heavy truck you see
the car ahead of you slam on its brakes. From visual cue to dead stop
is a very long time, more so at higher speeds. Just hope you're the
truck and not the car, because we have not only the finite reaction
time of the driver, but also the limited rate at which the brakes can
dissipate the momentum of a fast-moving massive vehicle. Thus latency.

.



Relevant Pages

  • Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
    ... to true has no effect - namely, 'scrolling the graph' still ... The reason the Autoredraw method works is because your entire "clearing and drawing code" runs in a closed loop for each specific "frame", and the VB Autoredraw method will not actually display the new frame until that "closed loop" code has finished. ...
    (microsoft.public.vb.general.discussion)
  • Re: Horizontal ScrollBar+ PictureBox + Flickering (how to stop flickering?)
    ... In that case then if you are drawing directly to the display there is a possibility that sometimes the next actual hardware video frame will occur in between the time that you cleared the display and before you have drawn the new graph on top of the cleared display. ... If you want to take it further and if you want to also eliminate that specific cause of flicker then you need to clock your drawings to the actual video hardware frame rates, which usually means using DirectX. ...
    (microsoft.public.vb.general.discussion)
  • Re: 1080i v 1080p...
    ... the 'pixels' of each frame be buffered until each frame is complete, ... That is buffering, not deinterlacing. ... Why is it necessary to de-interlace interlaced source material to display it ...
    (uk.tech.digital-tv)
  • Re: Aspect ratio explanation needed, please!
    ... The source material was 1.8 anamorphic, the output was xvid ... Three different players: ... needed to set aspect to 16:9, then display was perfect ... My surprise is that an xvid encoded, filled 720x480 frame ...
    (rec.video.desktop)
  • Re: Help: a handheld image processing device
    ... between and after frame captures. ... NOT have a USEB/IEEE1394/or other interface. ... LCD interface and camera ... LCD display and fairly high res CMOS cameras that will plug in to the 20 pin ...
    (comp.arch.embedded)