SwiftBOBS now available! (2D sprite system)

Miscellaneous Forums/Blitz Showcase/SwiftBOBS now available! (2D sprite system)

Okay I decided to purchse Blitzplus instead of using the buggy demo, and I can now report that the method I described above now works much better!

What method is that?

Triple buffering!

Rendering normal BOBS using triple buffering, you get a performance decrease when rendering normal bobs, but a huge performance increase when rendering any blended bobs.

Here are some numbers:

Rendering 500 BOBS at once:

Without triple buffering:
Normal - 200
Alpha - 11
Multiply - 2
Add - 2
Multiply x2 - 2

With triple buffering:
Normal - 58
Alpha - 20
Multiply - 16
Add - 19
Multiply x2 - 16

And that's rendering 500 30x30 sprites. So, you're pushing around 450,000 pixels per frame with those numbers. And that doesn't count redrawing the background.

Triple buffering is easy to implement in your game and does not require any special programming to handle your other graphics.

To do triple buffering, all you need do is create an image the same size as your screen, and Setbuffer ImageBuffer(Triplebuffer) at the start of your program. All draw operations will then go to the triple buffer. Then just before you flip, you set the back buffer to be the draw buffer, copy the triplebuffer to the back buffer with drawblock(), reset the triple buffer to the draw buffer, and the flip.

That's all there is to it!

The reason this works is because it is much faster in BlitzPlus to read pixels from an image, than it is to read them from the screen. And blending operations need to read a lot of pixels. This method will NOT improve the performance of the system with Blitz 3D however.