Pi and OpenGL?

I’ve been asked for a project where I would need to research more information than I currently have time for.
Does anyone know if a Pi 3 is strong enough to display, say, a full screen 3D animation of a cube running videos on some of its sides?
(And if so: Would some 3D wizard be willing to assist me (against payment) in doing so later this year?)

Hi Ulrich,

Unfortunately, the Raspberry Pi 3 B+ is not powerful enough to do what you asked with Xojo.

I created a cube that was spinning, no video, no texture, and a simple filled square and measured the fastest frame rate that I could with OpenGL on Xojo (Example 6-1 from my OpenGL book with the modified ability to maximize the screen). The speed varied between 5-7 frames per second at full-screen on the Raspberry Pi. Running a video would require a frame rate of at least 20 frames per second for each side of the square. Processing two squares would require more processing cycles, and would lower the frame rate more.

Sorry, the Raspberry Pi with Xojo isn’t good enough to play a full screen animation of a cube running videos.

Could you generate a video of a rotating cube with its videos and play that?
The video would have to be assembled a frame at a time but that is doable (not be me!).
The downside is that it would not be interactive - you would not be able to control the cube rotation in real-time for example.

Should be possible:
http://www.raspberryconnect.com/gamessoftware/item/314-trying_out_opengl_on_raspberry_pi_3

Note that you may wanna set the video buffer higher and set the processor fequency in the boot config.

I’m not an opengl guru but if xojo has opengl for pi it could as well be working the same.

Thanks all! Although I now have contradicting opinions – Derk’s link shows several games running at around 60 fps on a Pi, so a cube should definitely be smooth. @Eugene, did you enable the real hardware drivers like written in the article?

@Robin, a prerendered video would not be possible, but maybe the customer can go with stills of the videos instead of playing ones. Which I would prefer anyway as this should be running all day and I am afraid even a fan could be insufficient to save the Pi(s) from an early dead then. I guess video decoding + openGLing would put a lot of stress on the system. Which is why I would rather not overclock the CPU.

https://hackaday.com/2013/07/20/water-cooled-raspberry-pi/ :slight_smile:

Yes. Ehm. Please don’t challenge my mechanical talents! I still remember the cemetery of Ataris I soldered to death.

That’s a real crime ! :wink:

No, I did not enable the OpenGL drivers that is mentioned in the article. I would love to try it, but I will not be near my development computer until Friday. Maybe someone else could try it? If not, then I will try it on Friday.

I was young and did not need the money :smiley:

There are lots of 3D games and educational 3D software running perfectly fine on the Pi Here you can see an example of a cube running videos on a Raspberry 1, yes, the first one:

Video

So, the raspberry 3 is MUCH more powerfull than that, it also has a dedicated Kernel Mode-Setting for OpenGL preinstalled in the latest OS.

The poor frame rate problem is NOT in the hardware.

Ref: The ‘Video’ link in the previous post.

The link to Luca Carlon’s blogpost containing references to source code and other resources is a little hidden (click on ‘More’).
This is the link: http://thebugfreeblog.blogspot.com/2012/12/decoding-and-rendering-to-texture-h264.html

A rotating cube with video on the faces looks doable - given the video evidence.
That video is 7 years old - so you have to work getting the code updated! :slight_smile:

Thanks, @Robin! A lot to modernize, IMHO. The links just leads me to an empty example domain :wink:

If a Pi 3B can run videos 24/7 under the Kodi package, a rotating cube with some smallish rendered viewers running won’t create a cooling problem. Just a basic Pi case with the heatsinks and a cooling fan are quite sufficient. I like this case/fan set for the 3B/3B+:

https://www.amazon.com/dp/B07D3S4KBK/

I don’t like it, see the description from Amazon: "(Not Compatible With the Latest Pi 3 B+) " in the header of the page.

The product has an option, to choose beetween “Pi 3B/2B” AND Pi 3 Model B+

I just made it back to my development computer and changed the Raspberry Pi configuration changes to see the change in performance.

Following the directions at Raspberry Connect, the mesa-utils were installed by default on my Raspberry Pi 3 B+. I tried both Full KMS and Fake KMS settings and here are the results:

[code]Setting Frames Per Second
Default (No Move, Xojo) 5-7

Fake KMS (GlxGears) 60
Fake KMS (Move Mouse, Xojo) 6
Fake KMS (No Move, Xojo) 12

Full KMS (GlxGears) 60
Full KMS (Mouse Move, Xojo) 6
Full KMS (No Move, Xojo) 12
[/code]

The Xojo program was just a cube rotating at full screen size. There was no texture, and no video running.
Note: When I move the mouse over the OpenGLSurface control, then the frames per second decreases. There is a similar anomaly with OpenGLSurface on Windows.

@Eugene Dakin did you “sudo raspi-config” and tried the different OpenGL settings?

Yes i did try different settings Derk. Thanks for asking.

Just a thought. Why don’t you just setup a server on the pi and then code the cube in three.js with videos. I Suppose you could connect this to a smart-tv or something running a browser. Could you provide more information about how you will display the cube ie. HDMI or an LCD Touch screen etc?