3D graphics library

Hi!

I recently released EmberGL, a low-level 2D/3D graphics library (similar to OpenGL/DirectX) featuring a tile-based software rasterizer. The library and the API has been specifically designed for microcontrollers to operate with very tight RAM budget. There are no dynamic memory allocs and it doesn't require memory for the entire frame buffer because of the tile-based rendering. For example I had it running using only 6kb of RAM while rendering to 320x240 display with depth buffer, though this was quite an extremely tuned example :smile:

The library supports several modern rendering features such as vertex/pixel/tile shaders, meshlet-level Hi-Z occlusion culling, programmable blending, MRTs, various fixed-function pipeline features (e.g. different depth formats & test, barycentric coordinate interpolation), etc. Shaders enable for example implementing custom lighting models with multiple light sources and doesn't limit to a fixed set of models. The library can be also used for efficient flicker-free 2D rendering as shown in one of the examples.

Currently the library has 2 display driver implementations (ILI9341 with DMA support and ILI9488 with 8bit parallel interface) and I have been testing it on Teensy, but it's quite easy to add support for more displays because everything except the display driver code is platform agnostic C++.

You can download the library from here or via Arduino IDE (search for "EmberGL" in the library manager), and there are bunch of verbosely commented examples to get started. Have fun!

Cheers, Jarkko

2 Likes

Sorry, honesty speaking, I didn't understand much in your library. Can it be used as replacement of Adafruit_GFx library? Where are a elementary primitives as circles, rectangles etc?

This is a low-level graphics library which provides functionality for efficient and flexible triangle rasterization to render 3D/2D graphics, similar to OpenGL/DirectX/Vulkan, if you are familiar with those libs/APIs. The Adafruit library is a higher level GUI library.

Thanks for you answer. I again did not understand much, except of the fact that your library is not what I need :slight_smile:
Thanks again

Heh, no worries. If you need to render 3D objects, then it might be worth checking out :slight_smile:

interesting, this is what I needed, I wait for my tft 320x240 to arrive and test it with the rasberry pi pico

It says that there is redefinition of 'new' : 02_RotoMonkey - Wokwi Arduino and ESP32 Simulator
I use: Raspberry Pi Pico + ILI9341 + EmberGL + Wokwi :exploding_head:

With a Arduino Mega I get SPI errors: 00_HelloRect - Wokwi Arduino and ESP32 Simulator

For the 'new' issue, you could try to change the line 365 in egl_core.h from:

#if defined(ARDUINO) && !defined(CORE_TEENSY) // Arduino (except Teensy) doesn't have "new" header to define placement new operator

to

#if 0

The Wokwi simulator can import a library, but the source code of a library can not be changed.

I also tried the ESP32: 00_HelloRect - Wokwi Arduino and ESP32 Simulator

What happened ?
Let me rephrase that: You present an amazing graphical library on the Arduino forum, but which Arduino board works with the library ?

I have been testing it only on Teensy. Most of the code is platform agnostic though and only the drivers require board/display specific code.

It would be nice if it was compatible with Arduino hardware out of the box.

The Raspberry Pi Pico is supported by Arduino and the ESP32 is a "compatible" but the compatibility is very good and made by Espressif (the manufacturer of the ESP32).
The Teensy boards are also "compatible", but they go beyond the Arduino environment if needed.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.