Compatibility between OpenGL API , OpenGL ES and WebGL versions

Hello,

Good Day! I was wondering if it possible to port or switch between OpenGL applications to OpenGL ES and WebGL or vice versa?

Thank you.

AFAIK, WebGL(R) is based on the OpenGL ES(R) API. WebGL(R) is an in-browser JavaScript API. Your desktop GL and embedded GL applications are typically not written in JavaScript.

The various versions of OpenGL ES(R) are based on various versions of the OpenGL(R) but are stripped down to a more minimal subset for embedded systems.
When you use the desktop and embedded APIs in the same programming language (e.g. C), having backends for both becomes a feasible thing and there will
probably be lots of overlapping areas, but unless you keep to a common subset, a single backend for both probably won’t be possible.

There are extensions for desktop OpenGL(R) (see here and here) for compatibillity to GLES, making the whole thing easier.

Supporting both desktop OpenGL(R) and OpenGL ES(R) in the same application is possible and requires some porting (no simple snap-in replacement) and porting from GLES to desktop GL
is probably easier than doing the oposite.

The same application also supporting WebGL(R) IMO doesn’t really make any sense.

Since the 3 APIs share a lot of common concepts, learning one should be sufficient to also use another (after reading up on differences and specialities)

OpenGL® is an open standard API for hardware accelerated graphics rendering, typically implemented by a graphics driver on a desktop system.

OpenGL ES® is a simplified version for embedded systems (e.g. cell phones). There are (AFAIK) 3 versions based on 3 different versions of desktop OpenGL® and heavly simplified.
There are OpenGL ES® implementations for desktop systems, but neither can be used as a snap-in replacement for the other.

Getting a desktop OpenGL® program to run on an OpenGL ES® implementation requires some effort of porting the application. The reverse (porting from ES to desktop) is probably easier,
since the feature set of the target version is larger and also because for desktop versions, there is an extension to enhance compatibillity with the ES API.

WebGL® is an in-browser JavaScript API based on OpenGL ES®, so JavaScript code in an HTML5 web page can use hardware accelerated 3D graphics. Browsers typically implement WebGL®
by using OpenGL ES® in their backend (there is a project called ANGLE that provides an OpenGL ES® like API for Windows® systems by translating API calls to Direct3D® 9).

Using WebGL® and OpenGL® is obviously mutually exclusive.

[QUOTE=Agent D;1261862]OpenGL® is an open standard API for hardware accelerated graphics rendering, typically implemented by a graphics driver on a desktop system.

OpenGL ES® is a simplified version for embedded systems (e.g. cell phones). There are (AFAIK) 3 versions based on 3 different versions of desktop OpenGL® and heavly simplified.
There are OpenGL ES® implementations for desktop systems, but neither can be used as a snap-in replacement for the other.

Getting a desktop OpenGL® program to run on an OpenGL ES® implementation requires some effort of porting the application. The reverse (porting from ES to desktop) is probably easier,
since the feature set of the target version is larger and also because for desktop versions, there is an extension to enhance compatibillity with the ES API.

WebGL® is an in-browser JavaScript API based on OpenGL ES®, so JavaScript code in an HTML5 web page can use hardware accelerated 3D graphics. Browsers typically implement WebGL®
by using OpenGL ES® in their backend (there is a project called ANGLE that provides an OpenGL ES® like API for Windows® systems by translating API calls to Direct3D® 9).

Using WebGL® and OpenGL® is obviously mutually exclusive.[/QUOTE]

Thank you for your reply Agent_D