graphics123
graphics123

Reputation: 1271

Which version of OpenGL is supported by WebGL?

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.

Upvotes: 0

Views: 1675

Answers (3)

user128511
user128511

Reputation:

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

Upvotes: 2

MuertoExcobito
MuertoExcobito

Reputation: 10039

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.

Upvotes: 2

codetiger
codetiger

Reputation: 2779

WebGL is based on OpenGL-ES 2.0

Upvotes: 1

Related Questions