Which version of OpenGL is supported by WebGL? - opengl-es

I am in the process of reading WebGL and going through some tutorials .
But I think I had to learn OpenGL explicitly in order to work with WebGL more efficiently.
But there are many versions of OpenGL and this wiki link shows that WebGL uses OpenGL 2.0 but the latest version of OpenGL is 4.5 .
Can anybody suggest how to know which version of OpenGL is supported through some script in WebGL ,if possible.

WebGL is based on the OpenGL ES 2.0 API, however, there are some limitations they have adopted for increased availability.
The APIs of (modern) OpenGL, OpenGL ES, and WebGL, while not the same, are all closely related. If you know one, the usage of the other two is quite similar. In fact, you may be able to reuse a large amount of code between the three. So, knowing OpenGL would certainly help you implement a WebGL application, however, learning WebGL first is also plausible.

WebGL is not based on OpenGL. It is based on OpenGL ES 2.0. The same OpenGL ES found on Android and iOS.
There's significant differences between OpenGL and OpenGL ES. While OpenGL ES is a subset of OpenGL it is missing the old deprecated fixed function pipeline that so many people continue to use and so many outdated tutorials (like Nehe GL, still teach)
What's the fixed function pipeline? Anything having to do with glVertex, glColor, glNormal, glLight, glPushMatrix, glPopMatrix, glMatrixMode, etc... in GLSL using any of the variables that access the fixed function data like gl_Vertex, gl_Normal, gl_Color, gl_MultiTexCoord, gl_FogCoord, gl_ModelViewMatrix and the various other matrices from the fixed function pipeline.
Those are all removed from OpenGL ES 2.0 and therefore don't exist in WebGL

WebGL is based on OpenGL-ES 2.0

Related

Geometry shader in web

I'm interested to use geometry shader in web(site / application)
Is it possible to directly use opengl es 3.1 in web without webgl?
Is any other API to use newer version of opengl es than webgl2?
Totally is any way to I can use geometry shader in web?
thanks in advance
EDIT :
or is anyway to use opengl in web?
Is any other API to use newer version of opengl es than webgl2
No
Is it possible to directly use opengl es 3.1 in web without webgl
No
is any way to I can use geometry shader in web?
No
is anyway to use opengl in web?
No (wrt using anything else besides OpenGL ES 3.0 using WebGL 2.0)
I think that this feature can not be added to webgl2 by extensions
Well in theory it could, in fact the majority of API features were extensions once. As of now though there's no extension exposing geometry shaders for WebGL 2

should I use OpenGL 2.0 or 1.0 with libgdx?

So I've been using libgdx for a few weeks just to check what I can do, now I remember reading about the use of OpenGL 1.0 and 2.0. I am wondering what exactly is the difference between the 2 when using it with libgdx of course, can I just use OpenGL 2.0 for my projects and not worry about anything or is there some cons about it? So far I have only used 1.0, also I read about problems with compatibility when using OpenGL 2.0 is it true? I am interested about the compatibility of my future projects so would it be okay to just use OpenGL 2.0?
EDIT:
I am sorry I am talking about OpenGL ES 1.0 and 2.0.
Yes, there's some cons about OpenGL ES 2.0: Not every phone supports it already. I have a simple rule to decide use 2.0 or 1.0: If you wanna create ONLY 2D game, use 1.0. On contrary, if 3D game is in your favor, you have to use 2.0.
Besides, you have to decide from the beginning, or else you'll suffer from their inconsistance.

glFenceSync alternative in OpenGL ES 2.0

I see that glFenceSync does not exist in OpenGL ES 2.0, it was added only in OpenGL ES 3.0.
Does OpenGL ES 2.0 offer any alternative of syncing between CPU and GPU, aside from the brutal force glFinish?
You have different calls in OpenGL ES 2.0 that give some insight into different matters concerning GL, but mainly, you're left with glFinish only.
In glext.h.
GL_API GLsync glFenceSyncAPPLE(GLenum condition, GLbitfield flags) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0);
I am pretty sure this is what you want. Anyway available only on iOS 6.0 or later.

OpenGL ES 1.0 or 2.0

Recently I want to learn OpenGL ES. But I don't know which version should I learn.
I have tried OpenGL ES 2.0. You have to implement much functions that build-in OpenGL ES 1.0.
The Programmable Pipeline is trouble, despite it's powerful.
OpenGL ES 2.0 have been used in cocos2d 2.0.
Which version is widely in use?
Which one should I learn.
I'm a iOS developer.
As an iOS developer, you should probably allow yourself not to worry about devices on versions of the OS prior to iOS 5, meaning that you can really on Apple's GLKit to provide all the functionality that's in 1.1 but removed from 2.0. iOS device sales continue to grow exponentially and iOS 5 is available for devices from the 3GS onwards and so by the time you're up to speed you'll be losing very little in terms of potential audience.
GLKit supplies:
as many matrix stacks as you want (plus quaternions)
prepackaged shaders that match most of the ES 1.1 fixed functionality effects
standard bindings between OpenGL and UIKit (so you never need write your own UIView subclass for OpenGL again)
prebaked code for texture loading, synchronously and asynchronously
This is Apple's head documentation page for GLKit (and it's worth expanding the 'more'). iOS 5 and GLKit is quite new so external resources are still a little disorganised, but this one looks good enough.
Apple's intention is explicitly to allow someone who would otherwise stick with ES 1.1 because it does so much for you to get a working ES 2.0 implementation with very limited extra effort, with which they can then take advantage of the programmable pipeline in any way they see fit as they learn more about it. So I'd say that you should put your faith in Apple, take advantage of their code and learn ES 2.0 + GLKit right off the bat.

Using OpenGL ES on the Mac

Is it possible and not too complicated to use OpenGL ES for OS X development. I have been writing Mac applications for three years now and I am ready to start learning about OpenGL, but I want use OpenGL ES because there is a lot of information about using it with Xcode and Objective-C and from some of the code samples I found it seems easier to learn than the full OpenGL.
Thanks!
OpenGL-ES 1.1 is a true subset of OpenGL-2, ES-2 is a subset of OpenGL-3, the main difference is, how the context is created and managed. However context creation and management happen outside of OpenGL actually. So as long as you stick to OpenGL-ES, minus extensions specific to ES (i.e. OES extensions) you can do with an ordinary OpenGL context of the right version.
There are OpenGL-ES compatibility profiles, but those just disable functionality, don't add new one.

Resources