سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top