48

Can anyone give me a simple answer about the exact difference between OpenGL and WebGL? I need more specific on the following: programming semantics, API's inheritence, API's extensions etc.

I've looked at the following site but it is not very clear to me: http://www.khronos.org/webgl/wiki/WebGL_and_OpenGL_Differences

doppelgreener
  • 5,752
  • 8
  • 42
  • 59
Deepak
  • 936
  • 2
  • 8
  • 14

4 Answers4

50

WebGL is "OpenGL ES 2", not plain OpenGL (the ES stands for 'for Embedded Systems'). So there's the first difference. OpenGL ES is essentially a subset of OpenGL. In addition, WebGL is almost the same as OpenGL ES 2, but has some subtle differences, explained in the link you provide. There's not much to add to that link, it's a pretty clear explanation of what is different between OpenGL ES 2 and Webgl.

Mike 'Pomax' Kamermans
  • 40,046
  • 14
  • 84
  • 126
37

OpenGL is a desktopcomputer-centric API (like Direct3D). WebGL is derived from OpenGL ES 2.0 (intended for mobile devices) which has less capabilities and is simpler to use.

WebGL is also designed to run in a browser, and has therefore a few limitations more then OpenGL ES 2.0.

Unlike OpenGL, WebGL does not require native driver support. A wrapper called ANGLE, which Safari, Chrome and Firefox use can translate WebGL calls and GLSL to either OpenGL/GLSL or Direct3D/HLSL

Please see the Khronos wiki for a detailed answer: http://www.khronos.org/webgl/wiki/WebGL_and_OpenGL_Differences

Florian Bösch
  • 26,034
  • 11
  • 45
  • 52
11

WebGL is meant to run in a browser (web applications).

WebGL is a software library that extends the capability of the JavaScript programming language to allow it to generate interactive 3D graphics within any compatible web browser.
...
It uses the HTML5 canvas element and is accessed using Document Object Model interfaces. Automatic memory management is provided as part of the JavaScript language.


OpenGL is typically used in desktop applications. It is a cross-language, cross-platform specification, of which WebGL is more-or-less a subset.

Matt Ball
  • 332,322
  • 92
  • 617
  • 683
4

The consortium (https://www.khronos.org/webgl/) definition is quoted below.

WebGL is a cross-platform, royalty-free web standard for a low-level 3D graphics API based on OpenGL ES 2.0, exposed through the HTML5 Canvas element as Document Object Model interfaces. Developers familiar with OpenGL ES 2.0 will recognize WebGL as a Shader-based API using GLSL, with constructs that are semantically similar to those of the underlying OpenGL ES 2.0 API. It stays very close to the OpenGL ES 2.0 specification, with some concessions made for what developers expect out of memory-managed languages such as JavaScript.

OpenGL and WebGL have similar semantics but are coded in different languages. You will see at the basic level that most of differences are in the programming language constructs of C/C++ vs JavaScript

WebGL and OpenGL shows the similarities between the two, OpenGL in C/C++ and WebGL in JavaScript.

Community
  • 1
  • 1
ap-osd
  • 1,846
  • 12
  • 14