This 9×9×9 RGB LED Cube Has Its Own Video Game Graphics Engine
Greg Brault built this 9 9×9×9 RGB LED cube and a custom graphics engine to develop some interesting 3D games, including Doom.
LED cubes are neat and we see a lot of them around here. They’re fun projects that let makers escape the confines of the two-dimensional planes of breadboards and PCBs. Most of them do soothing and visually pleasing things, such as showing animated LED effects. But an LED cube is really just an LED matrix expanded into the third dimension, so you use an LED cube to display content like you would on an LED matrix. Greg Brault leaned into that fact to build a 9×9×9 RGB LED cube, complete with its own video game graphics engine.
This is the successor to a similar project Brault completed a decade ago, which was an 8×8×8 RGB LED cube that displayed simple games, such as Snake and Asteroids.
The 9×9×9 cube dramatically expands on that original concept and adds a lot more functionality. The additional LEDs do, of course, add more “pixels” (or maybe “voxels” is more appropriate?) to the display, but the new cube does more than just increase the LED count.
First, the new LEDs are WS2811 individually addressable RGB LEDs that don’t require multiplexing like the conventional RGB LEDs used in the 8×8×8 cube. Brault was able to control the WS2811 LEDs directly from an Arduino Nano ESP32 development board. The ESP32-S3 microcontroller on that board has two cores and Brault was able to devote one to controlling the LEDs through the FastLED Arduino library. Brault created an entire 3D graphics engine on that, which contains classes and structs (like voxels, meshes, and “world”) to make game development much easier.
The ESP32’s second core handles the game logic. Each “app” (or game) is self-contained in a header file and the custom framework can load a selected app via a menu system.
And because the ESP32 has a built-in BLE adapter, Brault was able to connect a BLE-capable gamepad. He wanted to output audio directly from the Arduino, but wasn’t able to get that working to his satisfaction. Instead, he used a DFPlayer Mini board to play game sound effects stored on an SD card.
With the LED cube hardware and the graphics engine to drive it, Brault was able to program several different games. The crown jewel is a reinvented Doom with a kind of third-person perspective, which is perfect for the true 3D display capabilities of the LED cube.