Fragment
Posts: 4
Joined: Sun Feb 05, 2017 9:30 pm

FBG : Framebuffer graphics library with multi-core support

Sun Jun 17, 2018 10:43 pm

Hello,

i am sharing a lightweight graphics library which use the Linux framebuffer (non-accelerated), it has full multi-core support (which was the main goal), it is mainly tested and developed on the Raspberry PI 3B.
Features :
* Optional : Full parallelism, execute graphics code on multiple CPU cores with a single function
* Displaying and loading PNG images (provided by LodePNG library)
* Bitmap fonts for drawing texts
* Bare-metal graphics primitive (pixels, rectangles, lines, polygon)
* Double buffering (with optional page flipping mechanism)
* 16, 24, 32 bpp support
* Easy to do fading and screen-clearing related effects (motion blur etc.)
* Framerate tracking & display for all cores
* Lightweight enough to be hackable; adapt to all kinds of needs (and still support parallelism easily)
https://github.com/grz0zrg/fbg

Here is a small screenshot of the full example with graphics code running on 3 cores on a Raspberry PI 3B (320x240) :

Image

This example feature an unoptimized fullscreen per pixels perlin noise with texture mapping and scrolling.

Image

Fullscreen texture-mapped and animated tunnel made of 40800 2px rectangles with motion blur (unoptimized)
Last edited by Fragment on Wed Jun 27, 2018 12:48 am, edited 1 time in total.

Oneil974
Posts: 10
Joined: Mon Jul 31, 2017 6:09 pm

Re: FBG : Framebuffer graphics library with multi-core support

Wed Jun 20, 2018 4:11 pm

Hi,

Amazing work, do you think it could be used to make graphics for videogames?

Fragment
Posts: 4
Joined: Sun Feb 05, 2017 9:30 pm

Re: FBG : Framebuffer graphics library with multi-core support

Wed Jun 20, 2018 4:40 pm

Sure, it can be used to make anything related to graphics.

However this library is very bare-metal (not specialized for video games) and graphics are not accelerated by the PI GPU, as such there might be better alternative for video games on the PI. :)

Oneil974
Posts: 10
Joined: Mon Jul 31, 2017 6:09 pm

Re: FBG : Framebuffer graphics library with multi-core support

Wed Jun 20, 2018 5:06 pm

Oh ok. Could I make an animated graphic boot screen for raspbian?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20751
Joined: Sat Jul 30, 2011 7:41 pm

Re: FBG : Framebuffer graphics library with multi-core support

Wed Jun 20, 2018 8:57 pm

Fragment wrote:
Wed Jun 20, 2018 4:40 pm
Sure, it can be used to make anything related to graphics.

However this library is very bare-metal (not specialized for video games) and graphics are not accelerated by the PI GPU, as such there might be better alternative for video games on the PI. :)
Implement some of the primitives using NEON and I think it would be pretty good for games! Nice work!

Sprites would be a good addition if not there already.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Fragment
Posts: 4
Joined: Sun Feb 05, 2017 9:30 pm

Re: FBG : Framebuffer graphics library with multi-core support

Wed Jun 20, 2018 11:22 pm

Oneil974 wrote:
Wed Jun 20, 2018 5:06 pm
Oh ok. Could I make an animated graphic boot screen for raspbian?
Yes, however i don't know how that work
jamesh wrote:
Fragment wrote:
Wed Jun 20, 2018 4:40 pm
Sure, it can be used to make anything related to graphics.

However this library is very bare-metal (not specialized for video games) and graphics are not accelerated by the PI GPU, as such there might be better alternative for video games on the PI. :)
Implement some of the primitives using NEON and I think it would be pretty good for games! Nice work!

Sprites would be a good addition if not there already.
Thank you! Sprites can be done with clipped images. :) Might take a look at NEON

Return to “Graphics programming”