El-gpu and pix-el: GNU Emacs 2D and 3D game programming

Emanuel Berg (he/him) - Pronunciation: Swenglish, IRC: lacni, incal@dataswamp.org

The following image shows where the talk is in the schedule for Sun 2026-12-13. Solid lines show talks with Q&A via BigBlueButton. Dashed lines show talks with Q&A via IRC or Etherpad.

Format: 20-min talk ; Q&A: BigBlueButton conference room https://media.emacsconf.org/2026/current/bbb-el-gpu.html
Etherpad: https://pad.emacsconf.org/2026-el-gpu
Discuss on IRC: #emacsconf
Status: Waiting for video from speaker

Times in different time zones:
Sunday, Dec 13 2026, ~11:10 AM - 11:30 AM EST (US/Eastern)
which is the same as:
Sunday, Dec 13 2026, ~10:10 AM - 10:30 AM CST (US/Central)
Sunday, Dec 13 2026, ~9:10 AM - 9:30 AM MST (US/Mountain)
Sunday, Dec 13 2026, ~8:10 AM - 8:30 AM PST (US/Pacific)
Sunday, Dec 13 2026, ~4:10 PM - 4:30 PM UTC
Sunday, Dec 13 2026, ~5:10 PM - 5:30 PM CET (Europe/Paris)
Sunday, Dec 13 2026, ~6:10 PM - 6:30 PM EET (Europe/Athens)
Sunday, Dec 13 2026, ~9:40 PM - 10:00 PM IST (Asia/Kolkata)
Monday, Dec 14 2026, ~12:10 AM - 12:30 AM +08 (Asia/Singapore)
Monday, Dec 14 2026, ~1:10 AM - 1:30 AM JST (Asia/Tokyo)
Find out how to watch and participate

Description

In this project, prepared especially for EmacsConf 2026, the two packages - el-gpu and pix-el - for graphics on the GPU as well as the CPU - have joined forces and been adapted to the CANVAS ARGB32 format, an exciting feature recently added to vanilla GNU Emacs.

We show no less than three games in this video:

  1. a snake clone, which operates on a per-pixel basis;

  2. a Tetris clone which loads its tiles on the fly from an arbitrary texture, even as that only exists in the drawing program as a dynamic, still editable object; and

  3. a Descent-like space game, powered-up by SDL (input, system glue) and OpenGL (3D graphics), executing part CPU-side Emacs Lisp (Elisp), part CPU-side dynamic-module C, and part all-GPU GLSL vertex and fragment shaders.

Like its predecessor, known simply as "the studio" [1] pix-el comes with an interactive environment offering a touch-key graphic manipulation/control interface, inside an Emacs buffer, not to produce graphics necessarily, but to make it come alive. Features are

  1. OOP-style drawing moving around parameter-defined boxed data;

  2. but also explicit pixel-plotting;

  3. with independent layers;

  4. with procedural shaders for generative/glitch-style graphics, but also for effects, mood lighting, or the illusions of metal and other realistic materials;

  5. with alpha masks, expressed with familiar Elisp lambda and defun;

  6. with RGB bitwise and color channel wise blenders, to produce pleasant colors in general, or do specific things e.g. transparency;

  7. also with animated sprites and custom blitting to scale, flip, rotate, and transform any graphical object;

  8. pix-el, being optimized in many ways big and small primarily to be able to iterate a 1920x1080 pixel monitor, in both Elisp and C, for this purpose relies on a C dynamic module, for example to implement emacs_gpu_array, which is very similar to the Elisp cl-replace, i.e. to do bounded array manipulation between indexes, however being in C and not by all means native compiled Elisp, emacs_gpu_array is often 150 times faster;

  9. meanwhile, with new idiomatic GNU Emacs Lisp constructs, e.g. the with-pixels macro, as-fast-as-it-gets Elisp-side iteration and pixel access;

  10. el-gpu and pix-el have new, interesting ways of drawing text, and images, to the point drawing can happen exclusively on the GPU, drawing platonic polyhedra (from the theory of 3D drawing), to Minecraft adventure lands, or random web PNGs, to a usable, running instance of GNU Emacs itself.

By Emanuel Berg incal@dataswamp.org

https://dataswamp.org/~incal/emacsconf2026/glsl-old-tiles.png

https://dataswamp.org/~incal/emacsconf2026/ui-elements.png

https://dataswamp.org/~incal/el-gpu

Questions or comments? Please e-mail emacsconf-org-private@gnu.org