Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Productions > Multiple Buffering Demos
2025-04-18 21:23
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.
2025-04-18 23:32
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.
2025-04-18 23:53
wacek

Registered: Nov 2007
Posts: 526
Almost all my effects are doublebuffered. I just hate update bugs on any type of effects.
2025-04-19 03:12
Mr SQL

Registered: Feb 2023
Posts: 158
Quoting wacek
Almost all my effects are doublebuffered. I just hate update bugs on any type of effects.

X2.

Quoting Mixer
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.

Interesting use in plotters and vector graphics and that the extra buffering can add a two frame lag.
2025-04-19 10:29
Krill

Registered: Apr 2002
Posts: 3083
Quoting Mixer
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.
Triple-buffering also helps if there is some non-trivial variation in render times from one frame to the next.
2025-04-19 11:01
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.
2025-04-19 16:35
chatGPZ

Registered: Dec 2001
Posts: 11510
Mmmh i have used triple buffers somewhere - but i can't remember what effect it was /o\
2025-04-19 16:51
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.
2025-04-19 20:01
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."
2025-04-19 21:10
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 :)
2025-04-22 21:43
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
WVL/Xenon
A3/AFL
cba
Higgie/Kraze/Slackers
Fred/Channel 4
RetroGL
jamespurcell
Guests online: 252
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Diskmag Editors
1 Magic  (10)
2 Jazzcat  (9.5)
3 hedning  (9.2)
4 Elwix  (9.1)
5 Peter  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.09 sec.