I can't seem to find a clear answer on this, despite hours of googling. Can someone just tell me what's going on? I get errors saying things like, "version 140 is not supported." Is this my device (Kindle Fire) or GL ES 2.0? Do I need to add libraries or anything?
You pick the GLSL version for the version of OpenGL that is your minimum supported version. If your minimum supported GL version is 2.1, then your GLSL version should be 1.10. If your minimum supported version is GL 4.1, then your GLSL version should be 4.10.
GLSL is a C-style language. The language has undergone a number of version changes, and it shares the deprecation model of OpenGL. The current version of GLSL is 4.60.
As also covered by Mattsills answer GL Shader Language or GLSL is a part of OpenGL that enables the creation of algorithms called shaders in/for OpenGL. Shaders run on the GPU.
WebGL 1.0 only supports GLSL 1.0. 17. (Remember that WebGL is based on OpenGL ES 2.0, which was designed for computing devices with low power and limited processing.)
The OpenGL ES 2.0 spec refers to GLSL ES, which is not the same as GLSL.
The spec GLSL ES spec says:
This version of the language is based on version 1.10 of the desktop GLSL. However it includes a number of features that are in version 1.20 but not 1.10.
Check out the spec to see what's supported.
OpenGL ES is not OpenGL, so similarly OpenGL ES's shader language is not OpenGL's shader language. They are similar, but they are not the same. So there is no desktop GLSL version that matches with GLSL ES's version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With