| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Multiple Buffering Demos
This thread is inspired by Sokrates double buffering thread:
Release id #252024 : C64ColorRamDoubleBuffer
In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete (though perhaps old) version of the data instead of a partially updated version of the data being created by a "writer".
https://en.wikipedia.org/wiki/Multiple_buffering
Are there any Multiple Buffering Demos?
This demo shows one example:
Christmas Inertia
This example is frame based. The display buffers are prepared prior to rendering the screen and can be updated with lazy writes while the screen is displayed.
The colorRAM in this example is static but the development kit now supports multiple buffering for colorRAM. |
|
| |
Mixer
Registered: Apr 2008 Posts: 460 |
Double and triple buffering was used in vector graphics and plotters and such math effects. Not that much in cycle dependent effects. I guess the reason for third buffer was that to use the calculation time effectively. f.ex if it takes 1.5 frames to draw, then you lose 0.5 frames until you can swap the displayed bitmap. So, begin drawing 3rd frame instead. |
| |
wacek
Registered: Nov 2007 Posts: 526 |
Almost all my effects are doublebuffered. I just hate update bugs on any type of effects. |
| |
Mr SQL
Registered: Feb 2023 Posts: 158 |
Quoting wacekAlmost all my effects are doublebuffered. I just hate update bugs on any type of effects.
X2.
Quoting MixerDouble and triple buffering was used in vector graphics and plotters and such math effects. Not that much in cycle dependent effects. I guess the reason for third buffer was that to use the calculation time effectively. f.ex if it takes 1.5 frames to draw, then you lose 0.5 frames until you can swap the displayed bitmap. So, begin drawing 3rd frame instead.
Interesting use in plotters and vector graphics and that the extra buffering can add a two frame lag. |
| |
Krill
Registered: Apr 2002 Posts: 3083 |
Quoting MixerI guess the reason for third buffer was that to use the calculation time effectively. f.ex if it takes 1.5 frames to draw, then you lose 0.5 frames until you can swap the displayed bitmap. So, begin drawing 3rd frame instead. Triple-buffering also helps if there is some non-trivial variation in render times from one frame to the next. |
| |
cobbpg
Registered: Jan 2022 Posts: 45 |
Stunt Car Racer doesn't waste time either after finishing work on frame 2 while presenting frame 1, it immediately starts processing the physics calculations for frame 3. It works out because that part of the workload always takes long enough that it can start presenting frame 2 by the time it needs to clear the back buffer. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11510 |
Mmmh i have used triple buffers somewhere - but i can't remember what effect it was /o\ |
| |
WVL
Registered: Mar 2002 Posts: 924 |
The bitmap-mover in Halloweed IV uses a triple buffer. This is to save cycles preparing the next bitmap (which is shifted up by 6 rows). The part copies bytes from the displayed bitmap to the next bitmap (but 6 rows higher) and can reuse the byte for the third bitmap (12 rows higher).
This was needed to make the >25 rows of bitmap data possible (besides copying the bitmap up, the part also has to copy a new line at the bottom in each frame and the data also gets reused in bitmaps 2 and 3). Without triple buffering the copying was too slow.
The copies are also optimized to not pass page boundaries and such things. |
| |
hollowman
Registered: Dec 2001 Posts: 475 |
Nothing But Code/Beyond Force
"...a piece of advice to coders outthere: use triple buffering to prevent frame update bugs.
.. i've seen some terrible bugs in c64 and pc-demos lately." |
| |
mankeli
Registered: Oct 2010 Posts: 152 |
First effect in Skybox (scrolling petscii screen) was doublebuffered! :P
But since it was in screen mode, and d800 can't be doublebuffered in full resolution, it was updated in several passes less tall passes while racing the beam..
And afaik on Atari ST, some of the largest rotating 3d objects are done with multiple buffers (like 16 or more) in a such way that CPU renders frames as fast as it can, and then interrupt switches buffers 50Hz. It's a very obvious thing but apparently not very common on Amiga or something :) |
| |
Monte Carlos
Registered: Jun 2004 Posts: 370 |
I feel,the technique is too widely applied to discuss in a thread. Even mentioning only the names of releases with dbl bffr would fill a bible. |
... 5 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 - Next |