Sunday, May 5

Coder crafts smooth 3D graphics engine from scratch, runs it on DIY GPU

Serving tech lovers for over 25 years.

TechSpot indicates tech analysis and recommendations you can rely on.

Why it matters: In a world controlled by effective GPUs from Nvidia and AMD, one self-taught coder is showing that it’s possible to develop remarkable 3D graphics from scratch. Alex Fish has actually launched an extremely smooth 3D engine that runs on a little homemade GPU powered by an Espressif ESP32-S3 microcontroller.

This isn’t Fish’s very first endeavor into homebrew graphics. He at first established the “Pescado” engine in WebGL for web internet browsers, then ported it to OpenGL for PC graphics cards. Accomplishing smooth 3D rendering on a low-power microcontroller is a considerable leap.

Fish’s engine, called “ESPescado” for the ESP32 port, is totally handcrafted utilizing C++ and OpenGL. He produced the vector, matrix, and rendering mathematics libraries from scratch. As Fish discusses, “the physics and geometry processing happen in 3D, however when showing the image on a 2D screen, just 2D points can be outlined.”

ESPescado utilizes point of view forecast to flatten the 3D items into 2D for the screen.

It’s rather responsive. Thanks to the ESP32’s dual-core style, Fish’s code can manage physics and input processing at 700 frames per 2nd on one core, while the other core concentrates on efficiently rendering wireframes at 40 fps.

The hardware itself is a hacker’s dream: a compact 1.9-inch, 320 x 160 pixel screen surrounded by ESP32 brains, coupled with external joysticks that permit complete 3D control. One joystick even connects to your finger for an immersive experience. An accelerometer supplies movement input for changing the in-game video camera.

See: FuryGPU is an open source hardware GPU constructed from scratch

Under the hood, ESPescado uses the basic 3D toolkit of meshes, vertices, and matrices. Meshes, built from triangles of points and lines, form the standard items and surface seen in computer game. The engine can then use improvements like scaling, turning, and placing to put these meshes in the virtual 3D world.

A YouTube demonstration showcases ESPescado in action, with Fish controling an easy green triangular item versus a black background. It uses a fundamental insight into the engine’s abilities, showing that even the most basic 3D graphics can be established from very first concepts.

For tinkerers and trainees of 3D mathematics, Fish’s task supplies a remarkable peek into the core ideas behind 3D engines. Both the ESP32 “ESPescado” variation and the initial OpenGL “Pescado” have actually been launched on GitHub for anybody to study and build on.

ยป …
Learn more