OpenGL -> OpenGL ES

BlitzMax Forums/OpenGL Module/OpenGL -> OpenGL ES

Brucey(Posted 2014) [#1]
Has anyone around here tried porting their GL stuff to ES?

Can most of the code stay the same, or are many of the API calls very different?

I'm thinking about OpenGL ES 2.x, which is what the Pi supports, and I presume iOS does too, generally.


Kryzon(Posted 2014) [#2]
Hello.
OpenGL ES is a different API than OpenGL, and therefore they are not directly compatible. The ES specification has less features.
Certain ES specification versions are correlated with GL versions, so these pairs should be more easily ported.

- http://wiki.maemo.org/OpenGL-ES#OpenGL_ES
- http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0363d/CJAJHGHF.html

You may also want to look at Adam Redwoods' work with his Monkey-X port of MiniB3D, which has ES 1.1 and ES 2.0 renderers if I'm not mistaken:
https://github.com/adamredwoods/minib3d-monkey/tree/master/opengl


Chapman7(Posted 2014) [#3]
Also, Simon ported Minib3d to be compatible with iOS (iMinib3d). It uses OpenGL ES and is something worth checking out.


markcw(Posted 2014) [#4]
And then there's Mojo3d.
http://www.monkey-x.com/Community/posts.php?topic=5548&page=5


Bobysait(Posted 2014) [#5]
Mostly anything working on open GL standard can be ported to ES, BUT (!)
Almost all the graphics process need to be rewrite with shaders
all the camera stuff has been removed, the pop/push matrix system removed too, so there is a major work to do to get all the fixed functions working/replaced.

If you're familiar enough with matrix and shaders, it won't be a big deal at all, the real challenge is probably somewhere between getting a real similar camera projection and replacing materials with shaders (that's probably the biggest part)

To to this, I've made a scripted shader engine that creates shaders from small parts and generate full usable shaders on the fly, but, my aim what to reproduce the basic blitz3d stuff and its behavior ... so, if you just want a common shader engine, it's really a lot easier.
(I must admit it was not that easy, and required few monthes dealing with garbaged stuff to get some shared materials/copies of entity etc ... but anyway, it's a good experience whatever)

Finally, the good part is :
When you finally get it working, it's just a couple hour of coding to get it working also via eclipse+Android SDK (so, you 've got a blitzmax engine for linux+windows+mac and a similar engine (in java) working on android)


Kryzon(Posted 2014) [#6]
Hello Bobysait. It has been a while.


Bobysait(Posted 2014) [#7]
Hi Kryzon !
Sure, as pointed in previous post, I took a break with blitz to learn java (which is not hard at all ... fews days at most to get enough basis to program for android) and get a decent 3D engine that works with "low cost" tablet. So ... yep, it's been a while :)
Did I miss you ? ^-^


Kryzon(Posted 2014) [#8]
I remember you because of your coding style and application of mathematics, which I admire. I recognize that as a similar style of other great blitzers around here such as Stevie G and Floyd.

That sounds like an interesting project, your Java-based 3D engine. If you have a blog or website about it you should let us know.


Brucey(Posted 2014) [#9]
So, if we had a shader-based OpenGL module (whatever version of OpenGL that needs to be as a minimum), it would be fairly easy to include support for OpenGL ES 2, given it is also shader-based?

If you're familiar enough with matrix and shaders...

Not at all !
I generally leave graphics stuff to the clever people. ;-)


Derron(Posted 2014) [#10]
In other words:

Brucey is in need of someone familar with OpenGL ES and willed to work on getting BlitzMax-graphics working on OpenGL ES supporting devices.

This might be an additional "driver" for Max2D or a complete (but compatible?) replacement.

-> GLMax2D should get a cousin GLESMax2D etc.


bye
Ron


Bobysait(Posted 2014) [#11]
So, if we had a shader-based OpenGL module (whatever version of OpenGL that needs to be as a minimum), it would be fairly easy to include support for OpenGL ES 2, given it is also shader-based?


So, you intend to export blitzmax codes to an android apk ?
I would give it a try if I had a clue on how to link blitzmax and the android api ... (and a way to compile blitzmax codes with an external compiler)
(I must admit, I haven't even searched at all)


Brucey(Posted 2014) [#12]
So, you intend to export blitzmax codes to an android apk ?

At some point in the future, yes.

It is currently working on an ARM-based Raspberry Pi, so in theory it's only a logical step from there to jump onto ARM-based Android (Ouya, iOS, etc)


Kryzon(Posted 2014) [#13]
For cross referencing, skidracer seems to be doing progress with EGL:
- http://www.blitzbasic.com/Community/posts.php?topic=102843#1235565
- https://www.khronos.org/egl