### OpenGL on Buster on both Pi 3 and Pi 4

Posted:

**Thu Jun 27, 2019 10:59 pm**My Raspberry Pi 4 just arrived and I got to try out the new Raspbian Buster both on the Pi 4 and the Pi 3.

Good news: the usual OpenGLES things found in /opt/vc/src still works great out-of-the-box with Raspbian Buster on the Pi 3 (thus probably all earlier devices as well). This means you are not forced to use X11 and the new v3d driver on your existing devices and that you can still do OpenGLES on the zero without X11 using up all memory.

Pi 4: Trying to run the OpenGLES examples from /opt/vc/src fails. This is due to the Pi 4 missing the previous vc4 driver so to do any OpenGL at all on the Pi 4 you need to use the new v3d mesa driver (which is activated by default on the Pi 4) and run your things in X11. Initial tests with openarena on the Pi 4 gives weak performance compared to how Quake3 runs on the Pi 3 and I have yet to find any good best-practices / runnable demos that runs great (but maybe I havn't dug deep enough into these forums yet?).

My advice for anyone looking to do OpenGLES programming on the Pi is to use your existing Pi 2 or Pi 3 and toy around with those hello_pi examples that can be found in /opt/vc/src. Also have a look at the excellent work that paddyg has been doing here in the forum. There's also a Quake 1 port that runs great if you want to dive deep into code. Hopefully in 6-12 months things have matured a bit and more examples are available, ideally examples that are buildable for both the battle tested legacy vc4 driver and the new v3d driver which is required on the Pi 4.

For some inspiration as to what you can build, have a look at this example running on a Raspberry Pi 2:

https://www.youtube.com/watch?v=vgoi1n-x6ms

Good news: the usual OpenGLES things found in /opt/vc/src still works great out-of-the-box with Raspbian Buster on the Pi 3 (thus probably all earlier devices as well). This means you are not forced to use X11 and the new v3d driver on your existing devices and that you can still do OpenGLES on the zero without X11 using up all memory.

Pi 4: Trying to run the OpenGLES examples from /opt/vc/src fails. This is due to the Pi 4 missing the previous vc4 driver so to do any OpenGL at all on the Pi 4 you need to use the new v3d mesa driver (which is activated by default on the Pi 4) and run your things in X11. Initial tests with openarena on the Pi 4 gives weak performance compared to how Quake3 runs on the Pi 3 and I have yet to find any good best-practices / runnable demos that runs great (but maybe I havn't dug deep enough into these forums yet?).

My advice for anyone looking to do OpenGLES programming on the Pi is to use your existing Pi 2 or Pi 3 and toy around with those hello_pi examples that can be found in /opt/vc/src. Also have a look at the excellent work that paddyg has been doing here in the forum. There's also a Quake 1 port that runs great if you want to dive deep into code. Hopefully in 6-12 months things have matured a bit and more examples are available, ideally examples that are buildable for both the battle tested legacy vc4 driver and the new v3d driver which is required on the Pi 4.

For some inspiration as to what you can build, have a look at this example running on a Raspberry Pi 2:

https://www.youtube.com/watch?v=vgoi1n-x6ms