User avatar
boomonster
Posts: 61
Joined: Fri May 11, 2018 11:18 pm

3d graphics libraries that run on the Pi 2 that aren't slow?

Tue Jun 19, 2018 7:19 pm

Hello everyone,

Just wondering if there is a such thing
as a 3d graphics library/3d game engine
that isn't slow and laggy and doesn't push a
Pi 2 up to 100% CPU constantly... :lol:

Please help!
Boomonster

User avatar
Paeryn
Posts: 2141
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Tue Jun 19, 2018 7:48 pm

boomonster wrote:
Tue Jun 19, 2018 7:19 pm
Hello everyone,

Just wondering if there is a such thing
as a 3d graphics library/3d game engine
that isn't slow and laggy and doesn't push a
Pi 2 up to 100% CPU constantly... :lol:

Please help!
Boomonster
The obvious 3D graphics library is OpenGL|ES 2, 1 is also available but it's fixed-function rather than shader based. The VC4 hardware handles all the rendering so frees up the CPU to be doing other stuff.

As for game engines, not sure, but if one supports OpenGL|ES then you are half way there.
She who travels light — forgot something.

Heater
Posts: 9822
Joined: Tue Jul 17, 2012 3:02 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Tue Jun 19, 2018 9:24 pm

All I know is that writing OpenGl/ES using the Qt graphics libraries, straight into the frame buffer, no X11, works really well.

Or at least it did a couple of Pi versions ago when I compiled Qt5 from original sources.

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Tue Jun 19, 2018 10:08 pm

You might give Kivy a look: https://kivy.org/#home Built on OpenGL ES2 and has very nicely thought out Python API.
Installation: https://kivy.org/docs/installation/inst ... n-rpi.html

There's also a downloadable image available if you want to burn another SD card and test it out: http://kivypie.mitako.eu/kivy-download.html It won't give you the features of the current Raspbian, but enough to do some Kivy coding and see if you like it first.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

scotty101
Posts: 3085
Joined: Fri Jun 08, 2012 6:03 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Tue Jun 19, 2018 10:20 pm

Kivy isn't a 3D graphics library. It's just a shiny GUI library.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Tue Jun 19, 2018 10:34 pm

scotty101 wrote:
Tue Jun 19, 2018 10:20 pm
Kivy isn't a 3D graphics library. It's just a shiny GUI library.
Yep.
3d game engine
The event dispatcher and 3D capabilities in Kivy can qualify for usage as a "3D game engine" with appropriate game logic from say, Pygame.

The point being, you don't have a lot of choices for a low level graphics lib on an RPi2. So, unless you want to write your own display and event handlers for X11, OpenGL, OpenGl ES, Vulkan or "roll your own" for an ARM architecture, frameworks like Kivy are useful for what you do have.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Wed Jun 20, 2018 1:44 am

I did not have much hope of it being useful until I saw this
viewtopic.php?f=68&t=214695
Because Tim did it mostly on the VC4 it even ran on a Zero ;)

I now mostly run Gentoo64 and the Mesa3D demos just compiled and worked on it.
That is OpenGL using Eric Anholt's driver, not the best and fastest at full screen but the demos are not optimized for the Pi's.
Hardly any CPU usage.

I have yet to find a good game engine that makes the best use of the Pi's VC4 and is easy to learn ;) .
Godot might be small enough that it could be tweaked.

Android seems to do lots of OpenGLES, wonder if there is anything in that development world that could be used for Pi's?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Wed Jun 20, 2018 1:53 am

I ran across a little blurb about some work on porting Vulkan: https://www.phoronix.com/scan.php?page= ... -Code-Drop

It seems to be fairly active examining github commits: https://github.com/Yours3lf/rpi-vulkan- ... its/master

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Wed Jun 20, 2018 3:09 am

I ran across a little blurb about some work on porting Vulkan:
More Vulkan progress than I had expected, cool. - Bookmarked ;)
Probably now is a good time to start to learn how Vulkan works on normal PC's.

The problem with this bleeding edge stuff is it takes time for RPT to get it mainstreamed.
RPF needs reliable software for their mission, not stuff that only Eric or Boris etc have tested.

It normally means you need to learn how to compile everything yourself, Linux kernel and latest drivers etc.
Then you need to do the graphics on top of that.

Probably best to stick with OpenGLES for the moment.
You no longer even have to use Linux https://ultibo.org/
But a game engine will probably be C or C++ based

Looking at big engines like Unity it becomes obvious Vulkan is the future.
Could Unity Games run on PI's one day?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Wed Jun 20, 2018 3:22 am

I've played around with this for awhile: https://www.geeks3d.com/geexlab/

There are versions for all the major OS'es and the RPi. However, the RPi is limited to OGL 2.1. If you wanted to get your hands on a bit of Vulkan programming, this is an easy way to do it. If you check it out, be sure to also take at look at the samples packs, lots of code to learn from.

I run it on my Win7 box and Lubuntu lappy. Haven't had time yet for the RPi3B but it's on the agenda.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

ghans
Posts: 7792
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Wed Jun 20, 2018 4:29 am

All those engines support the Pi GPU:

https://urho3d.github.io/
http://www.raylib.com
https://github.com/tipam/pi3d

Most other engines do not explicitly target the Pi and will likely have horrible performance and will be diffucult to build from source, or both.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
boomonster
Posts: 61
Joined: Fri May 11, 2018 11:18 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Thu Jun 21, 2018 1:09 am

Hmm... :? Is there Open GL for Python?
That's where I can actually manage
programming. :( I thought there was some
sort of library, but I'm not sure. If I have to
do 3d game programming in C/C++, I probably
just won't try it.

User avatar
The Traveler
Posts: 361
Joined: Sat Oct 21, 2017 3:48 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Thu Jun 21, 2018 1:24 am

There is a Python binding to OpenGL in pygame. https://www.pygame.org/news
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

ghans
Posts: 7792
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Thu Jun 21, 2018 4:14 am

Pi3D uses OpenGL ES. "Real" OpenGL support for the Pi is new and not that well tested anyway.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Thu Jun 21, 2018 5:09 am

"Real" OpenGL support for the Pi is new and not that well tested anyway.
https://www.mesa3d.org/

Time for us to start testing.

I got the latest version and it works when compiled in Gentoo64.
ipers demo <14fps for 26584 polygons.
How fast is it on a normal 32bit OS?
Do different gcc versions and compilers switches make a difference?

As these seems to be the standard demos for mesa, there are lots of examples that can be tested.
And examined to see how OpenGL works ;) .

What tricks can be done to make demos full frame and 60fps?

I suspect OpenGLES will still be faster?
Is there OpenGLES versions of these demos?
https://www.mesa3d.org/opengles.html
Does that mean it does OpenGLES versions too?

Is it as simple as the compiler switch and a raspi-config change to test both on Raspbian?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Thu Jun 21, 2018 12:42 pm

Compiling the mesa3D demos on a Intel Core Duo 2.83GHz Linux Mint box was harder than Gentoo64 :o
Library dependencies yuk ;)
Got a nVidia 210 video board, nouveau driver, so not a fast PC at all.
The ipers example runs at 29fps, so just over two times as a Pi 3B+ ;)

Considering the 3B+ is 1.4GHz and the Intel is 2.83GHz the frames rates seem to match which is weird I would have thought the GPU's would make a bigger difference.

I only have the old Pi2's so I have to make a new 32bit Raspbian SD card before I can test ipers.
Benchmarks for Zero, B+, old 2B, 3B, 3B+ next up, both OpenGL and OpenGLES?

Ouch, lots of dependencies for Raspbian.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
paddyg
Posts: 2180
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Fri Jun 22, 2018 9:25 pm

Partly for my own entertainment/enlightenment I've been transcribing the pi3d python module to pi3d_rust for which I have used sdl2 with the raspbian experimental OpenGL driver. I've needed surprisingly few changes in the opengl and gles stuff. I still need to add comments to the code to point out why the differences are there etc. But it does run significantly slower than the Broadcom drivers, especially at large window sizes.

IMHO python is enough like a game engine scripting language that you can just write your game in python but you obviously have to be careful not to load in too many objects at once. Or leverage the speed of numpy in clever ways. (If you search on youtube for pi3d you will see various posts of what it does and how fast it runs)
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Sat Jun 23, 2018 2:49 am

This one seems to be up to date, ie still actively developed.
http://www.geeks3d.com/geexlab/

Been trying to get the mesa3d demos compiling in Raspbian I keep bumping into dependency issues.
Got spoilt in Gentoo64 as Sakaki must have them already installed ;)

OpenGL is also a moving target as Eric Anholt tinkers with the drivers.
There is a release lag as Eric's stuff goes upstream to Linux and then back downstream to RPF's Raspbian.
One dependency I had get the latest source from Eric's github.

Very hard to test the new open source GL driver if a bunch of dependencies need to be installed first.
And there is no guarantee the dependencies I grab are current either.
I know Raspbian is getting bloated but if it came with these and with all the mesa3d source installed it would be easier to test.

Probably the most reliable is going to be OpenGLES 2.1 as we know that has been working for years.
However I am very impressed so far with Gentoo64 which is using the open source VC4 driver.

If there is no bench marking we cannot tell which is the fastest 3D method.
The mesa3d demos was the first one I found that makes sense.

The problem with big benchmarks is they test the latest hardware/software, which the Pi's are not ;)
https://gfxbench.com/benchmark.jsp
Will it do OpenGLES 2.1?

There is 3D stuff is out there but it is not a matter of which is the fastest, it is more a matter which is not the slowest of the slow.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
boomonster
Posts: 61
Joined: Fri May 11, 2018 11:18 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Mon Jun 25, 2018 8:06 pm

Okay! I think I'll end up trying Open GLES 2.1
with Python bindings... ;) Here we go...

Thanks,
Boomonster

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Wed Jun 27, 2018 8:28 am

This was pointed out to me on another post, Kivy is Python based.
https://kivy.org/docs/examples/gen__3Dr ... n__py.html

viewtopic.php?f=67&t=216632
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
boomonster
Posts: 61
Joined: Fri May 11, 2018 11:18 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Thu Jul 05, 2018 9:53 pm

Yikes! Things are getting confusing...
I still would like to try open gl es, because
the glxgears openGL test runs at about 60 fps
without anything else running, and open gl es
shoulden't be much worse...

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Fri Jul 06, 2018 12:19 am

Yikes! Things are getting confusing...
I still would like to try open gl es, because
the glxgears openGL test runs at about 60 fps
without anything else running, and open gl es
shoulden't be much worse...
You make that glxgears window full screen you find out how bad OpenGL is at the moment.
es2gears should work fine fullscreen.

Here is what OpenGLES looks like when done by an expert
viewtopic.php?f=68&t=214695&start=50
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 2105
Joined: Wed Aug 28, 2013 3:31 am

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Tue Jul 10, 2018 1:40 pm

Here is what OpenGLES looks like when done by an expert
viewtopic.php?f=68&t=214695&start=50
Tim has tried this on a Zero but it gets hot so the VC4 must be working hard.

Is there a way to find out how hard the VC4 is working when doing mesa/OpenGL/GLES?
Does the VC4 have a way to report resource usage back to the Arm.
VPU%, QPU%,HVS% debug info etc
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
boomonster
Posts: 61
Joined: Fri May 11, 2018 11:18 pm

Re: 3d graphics libraries that run on the Pi 2 that aren't slow?

Wed Jul 11, 2018 7:29 pm

I've done the GLXgears demo fullscreen, and it
seems to run fine on my Pi 2 with 64 MB of GPU
RAM. It still makes about 60 FPS!!! I don't do
much 3d gaming, so OpenGLES's graphics look
fine to me!

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 5 guests