goxjs / gl

Go cross-platform OpenGL bindings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Supported OpenGL version

delaneyj opened this issue · comments

It seems odd that you are using OpenGL 2.1 for desktops but ES2 for mobile. Doesn't the ES2 spec basically match OpenGL 3.3? Is there more detail that I'm missing?

Hi @delaneyj,

Thanks for asking. That's a good observation.

See #9 for the PR that did it (in June 2015).

I don't have a very specific reason for it. I think it's because OpenGL 2.1 (with extensions) happened to be sufficient to implement the goxjs/gl API at the time, and I happened to use it. I could've also used OpenGL 3.3 or 3.2.

I think one additional factor might've been that earlier, macOS only implemented OpenGL 3.2 (not OpenGL 3.3) on core profile, and then it became 4.1 or so.

According to https://en.wikipedia.org/wiki/OpenGL_ES#OpenGL_ES_2.0:

It is based roughly on OpenGL 2.0, but it eliminates most of the fixed-function rendering pipeline in favor of a programmable one in a move similar to transition from OpenGL 3.0 to 3.1.

So it's closer to OpenGL 3.x in nature (due to removed fixed pipeline), but 2.x is quite relevant too.

In summary, OpenGL 2.1 was used because it's generally very compatible/universally available, and sufficient. However, OpenGL 3.x could've been used too, possibly without any difference in compatibility.

Is this causing any issues for you, or are you simply interested in finding out the reason for this?

Well getting back into the 3d realm. If I remember correctly OpenGL 3.3 was the first one that basically had all the FFP stuff not just deprecated but completely removed. Also it matches the ES spec closely with no extensions. The lack of fbo, vao, shader defined attribute locations which are all part of the ES.

Basically I was looking to port Three.js to Go (which I had done before in C#) and it looked like this was a great base for windowing/context cross platform part. Don't have specific things that are blocking but its easier to figure out what could be an issue instead of later.

I see you are active both in goxjs and the go-gl project. Which is the right binding for doing cross platform?

Basically I was looking to port Three.js to Go (which I had done before in C#) and it looked like this was a great base for windowing/context cross platform part. Don't have specific things that are blocking but its easier to figure out what could be an issue instead of later.

I see, makes sense.

Worth noting, while there aren't any entries for Three.js on the GopherJS bindings list wiki page, if you do a bit of searching, it seems multiple people have tried and have work-in-progress attempts. Perhaps it may be relevant for you. From a quick search, I found these (and there may be more):

I see you are active both in goxjs and the go-gl project. Which is the right binding for doing cross platform?

The scope of go-gl org is to support desktop OSes and maybe mobile OSes. That's it.

The scope of goxjs org is to support browsers, desktop, and mobile OSes. (It actually uses go-gl/gl bindings for desktop support at this time.)

Things move fast enough in Three.js that its easier to port in one big project than to try to parse the intent of an old port. The thing I like about the engine is its simple enough to grok the whole thing with a lot of abstractions, seemed to fit the ethos of Go well. I'll start using goxjs and if there are roadblocks will submit new issues with test cases. Thanks for the quick response!