WeightAn's Ray Marching Algorithm Turns an Arduino UNO Into a Seconds-Per-Frame 3D Renderer

Taking around 15 seconds to generate each frame, this 3D engine is unlikely to be of much use for twitch-gaming projects.

Gareth Halfacree
5 months agoDisplays / HW101

Pseudonymous developer "WeightAn" has put an Arduino UNO Rev3 board to work as a 3D rendering system — delivering a ray-marched animation at a rate measured in seconds per frame rather than frames per second.

"Ray marching on an Arduino UNO OLED 128×64 with dithering," WeightAn writes of the project, which renders its image in black-and-white with the dithering offering pseudo-gray tones. "15 seconds per frame."

For those used to doing 3D rendering on more powerful devices, that may seem like a mistake: most renderers are measured in frames per second, rather than seconds per frame. The Arduino UNO Rev3, though, is not a very powerful device. Based on the Microchip ATmega328P, the board has a single eight-bit microcontroller core running at 16MHz and no graphics acceleration hardware.

Despite this, WeightAn has been able to cram a 3D rendering algorithm into its limited resources. The program, just over a hundred lines of code in length, uses ray marching to display an animated donut on a connected SSD1306-based OLED screen. Though, taking 15 seconds per frame, it's easy to mistake the animation for a slow slideshow.

More information is available on WeightAn's Reddit post, while the source code has been published to GitHub under the permissive MIT license — along with a Mandelbrot set visualizer and an implementation of Conway's Game of Life running at 17 iterations per second.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles