Question

Is the shader language for WebGL the same as that for OpenGL? In other words, if I write a shader for WebGL will it be fully compatible with OpenGL?

I do not want to purchase a book about OpenGL Shading Language if it is not going to work for WebGL.

Was it helpful?

Solution

WebGL itself is more closely related to GLES2.0 than to desktop GL and thus uses the same shading language as ES2: The OpenGL ES Shading Language 1.0. This is somewhat similiar to the early desktop GLSL versions (like GLSL1.10 or 1.20 which were current at the time of GL2.x), but more limited. So buying a book about desktop GLSL might not be the best choice, you might want to look specifically for GLES ones.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top