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

Vulkan, OpenGL or OpenGLES

Sun Jun 24, 2018 8:25 am

I want to do 3D graphics for gadgets, single purpose applications that run on embedded Pi's.
What do I spend my time on learning now, Vulkan, OpenGL, OpenGLES?

Been looking for simple OpenGLES tools, most seem to be for Android.
There is better support for OpenGL, but I only have that compiling on Gentoo64 not Raspbian.

The VC4 has hardware accelerated OpenGLES.
Eric's OpenGL driver runs over the top of this OpenGLES.
I noticed that Vulkan does SPIR-V which does NIR which does VC4.

How long before Pi's can do Vulkan?
https://www.phoronix.com/scan.php?page= ... -Code-Drop

Vulkan can do 3Dstuff on Linux, Windows and Android but is harder to use.
So people use tools like Unity, Unreal etc
These can make stuff for Windows, Linux and Android, could they one day do Pi's?

Unless I missed it, we don't currently have an easy way to make 3D games and apps for Pi's on Pi's.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
karrika
Posts: 1041
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Vulkan, OpenGL or OpenGLES

Sun Jun 24, 2018 9:35 am

Vulcan is more for controlling the GPU in an optimal way. So you get the most out of the limited hardware by taking this route. It is also the hardest. It is very verbose and you have to write tons of stuff just to draw a triangle.

OpenGL on the other hand is about defining 3D graphics. So it is much easier to start with that.

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

Re: Vulkan, OpenGL or OpenGLES

Mon Jun 25, 2018 1:30 am

OpenGL on the other hand is about defining 3D graphics. So it is much easier to start with that.
Your probably right, the apps I want to do are not games(yet).
I just want to make use of the VC4 GPU to pretty up UI's on my gadgets.
As some of them are web servers and I also use Pi's as web interfaces to them perhaps WebGL will be the way to go.

That way I can use HTML5 for UI and web interfaces.
By the time I figure that out someone will have made what I want :D
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
johannesl
Posts: 14
Joined: Thu May 23, 2013 8:38 pm

Re: Vulkan, OpenGL or OpenGLES

Mon Jun 25, 2018 1:11 pm

Hi Gavin!
You should definitely go for OpenGL ES. The first place to start is looking at /opt/vc/src on your Raspbian installation and compile those examples. It will give you a lot of pointers and ideas about what to do next.

Don't hesitate to write me a message here on the forums or via email to [email protected] if you get stuck.

User avatar
PeterO
Posts: 4183
Joined: Sun Jul 22, 2012 4:14 pm

Re: Vulkan, OpenGL or OpenGLES

Mon Jun 25, 2018 1:14 pm

johannesl wrote:
Mon Jun 25, 2018 1:11 pm
Hi Gavin!
You should definitely go for OpenGL ES. The first place to start is looking at /opt/vc/src on your Raspbian installation and compile those examples. It will give you a lot of pointers and ideas about what to do next.

Don't hesitate to write me a message here on the forums or via email to [email protected] if you get stuck.
Actually those examples are not very helpful , some of them are quite old and use the fixed pipeline (GL ES 1) rather than shaders (GL ES 2).

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

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

Re: Vulkan, OpenGL or OpenGLES

Mon Jun 25, 2018 1:25 pm

Just my opinion, Vulkan will be the future I think. Right now you have "traditional" OpenGL and the fork for OpenGL ES, each targeting a different set of devices, desktop PCs and mobile devices respectively. As GPU acceleration on mobile devices improves, the rift in graphics performance will start to close. Vulkan will be the language that will span the gap.

While I wouldn't expect OpenGL to OGLES to disappear anytime soon, if I wanted to "future proof" myself, I'd spend some time learning Vulkan and keeping abreast of it's development.

Cheers.
Retired IT professional, programmer and "beardie weirdie".
RPi interests: Autonomous robotics and machine learning.
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

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

Re: Vulkan, OpenGL or OpenGLES

Tue Jun 26, 2018 12:57 am

You should definitely go for OpenGL ES. The first place to start is looking at /opt/vc/src on your Raspbian installation and compile those examples.
Been there done that, even played with Ultibo's baremetal ports.
https://github.com/ultibohub/Examples/t ... V/OpenGLES

Been reading all the books etc but none of it clicked until I saw Tim's Star Citizen models.
viewtopic.php?f=68&t=214695
Rotating cubes and triangles don't mean much but spaceships I get :D

For Vulkan on Pi we will need experts like Eric Anholt to optimize the driver.
Reading between the lines of his posts it is not easy and still needs lots of testing.
If Vulkan is not as fast as OpenGLES then it becomes pointless for the VC4 for gaming.
VC5 is another story, MMU etc

Actually probably need to learn Blender as well.
Tried many times before to learn it, it is big and powerful, but not the easiest thing to learn.
I found Moi3d the easiest to learn, too bad there is no Pi version.
http://moi3d.com/
Freecad is great for simple things, wonder if it can make spaceships?
OpenSCAD, is that on Pi's? Ouch need to build it?

There was a 3D modeler ported to Pi's? found it.
https://www.twistednormal.com/
Rats only STL, obj would have been better?
STL is triangles, so easy to port to OpenGLES triangles?

OpenGLES is just how it works, who really want to hand code vertices, textures and faces?
We really need 3D modeling software that does that for us.
Then there is the game engine needed to moved the 3D models around.

I guess if you have a game engine that does modeling and the 3D rendering it does not matter which method it uses as long as it works fast enough.
Doing UI's and data visualization with 3D is a little bit different, but even then people have used Unity to make UI's because it was easier..

Do OpenGLES right now, play with OpenGL in Gentoo64 and learn Vulkan for the future.
Find a 3D modeler/renderer/engine that work on Pi's.

So much to learn.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
karrika
Posts: 1041
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Vulkan, OpenGL or OpenGLES

Wed Jun 27, 2018 4:08 am

Blender is a long time friend. In the early days I was adding money to buy it free when the original company went bankrupt. Today I do all my 3D print designs with it.

But you can also export your 3D spaceships as Blender objects to be rendered by your Python code.

Kivy has a nice piece of code for demonstrating it. It runs nicely on a Pi. Kivy is also a very interesting environment. Not really mainstream stuff. But I keep using it instead of ordinary desktops. It fits the Pi + Official 7" screen very well.

https://kivy.org/docs/examples/gen__3Dr ... n__py.html

Image

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

Re: Vulkan, OpenGL or OpenGLES

Wed Jun 27, 2018 4:59 am

Kivy guys are complaining about OpenGL support at the moment ;)
viewtopic.php?f=66&t=216804

That code looks very simple :D

Have you done UV texture mapping in Blender/Kivy?
I am trying to learn this so I can do it in Ultibo, without any OS.

Tim's Spaceships, I'm Steampunk Zeppelins.
viewtopic.php?f=68&t=214695&start=25
https://ultibo.org/forum/viewtopic.php? ... 1&start=20
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: Vulkan, OpenGL or OpenGLES

Wed Jun 27, 2018 11:02 am

I do texture/uv mapping in blender then gimp. First unwrap the uv (smart unwrap is normally fine but might need some seams etc) then export it as an image. In gimp use the exported map as one layer and tweak your texture patches on other layers to match (the handle transform tool is good for this, can't remember if it was there prior to 2.10). It's very quick to do if, as you say, you discount the months of working out how blender works!
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 5 guests