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 actually don't have to add any libraries, 140 is far too new for Kindle Fire. Either remove the version specification or decrement it until the shader compiles. You may need to fix some other errors in the shader as the individual versions of the language do have some differences.
You can also query GL_SHADING_LANGUAGE_VERSION
using glGetString()
to get version of GLSL that is supported on your device (guaranteed to be 100 at least - ES 2.0 is the first one with a shading language).
Also, as mentioned by the others, OpenGL ES GLSL is not the same language as OpenGL ES (I thought that was rather obvious, OpenGL ES is not OpenGL) so the version numbers will not match. There is however GL_ARB_ES2_compatibility and its extensions to ES3, ES3.1 and ES3.2, where the mapping of the ES / non-ES GLSL languages is described, and using those it is possible to get ES-like functionality on an non-ES context.
#version ...
directive and immediately think that apples (desktop GLSL) are somehow comparable to oranges (embedded GLSL). They are similar in many respects, but divergent in many more (and version numbering is one area where they diverge drastically). Have a look at: opengl.org/registry/gles - if you look under the heading "OpenGL ES 2.0 Specific", that tells you the GLSL ES version associated with it. –
Invalid 140
in GLSL ES; we have 100
in ES 2.0 and the draft specification for ES 3.0 provides 300
. There have been no new language specification versions published in-between 2.0 and 3.0. –
Invalid 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.
you actually don't have to add any libraries, 140 is far too new for Kindle Fire. Either remove the version specification or decrement it until the shader compiles. You may need to fix some other errors in the shader as the individual versions of the language do have some differences.
You can also query GL_SHADING_LANGUAGE_VERSION
using glGetString()
to get version of GLSL that is supported on your device (guaranteed to be 100 at least - ES 2.0 is the first one with a shading language).
Also, as mentioned by the others, OpenGL ES GLSL is not the same language as OpenGL ES (I thought that was rather obvious, OpenGL ES is not OpenGL) so the version numbers will not match. There is however GL_ARB_ES2_compatibility and its extensions to ES3, ES3.1 and ES3.2, where the mapping of the ES / non-ES GLSL languages is described, and using those it is possible to get ES-like functionality on an non-ES context.
#version ...
directive and immediately think that apples (desktop GLSL) are somehow comparable to oranges (embedded GLSL). They are similar in many respects, but divergent in many more (and version numbering is one area where they diverge drastically). Have a look at: opengl.org/registry/gles - if you look under the heading "OpenGL ES 2.0 Specific", that tells you the GLSL ES version associated with it. –
Invalid 140
in GLSL ES; we have 100
in ES 2.0 and the draft specification for ES 3.0 provides 300
. There have been no new language specification versions published in-between 2.0 and 3.0. –
Invalid First of all you need to be clear:
- OpenGL and GLSL are for desktop
- OpenGL ES and GLSL ES are for Embedded System
If your system is using OpenGL ES 2.0, then you have to use GLSL ES 1.0 (Shader Preprocessor: #version 100)
It's tricky here that if you use #version 110 or #version 120, then the machine will understand that you want to use GLSL, not GLSL ES. Following table from Wikipedia will help you to be clear
Before OpenGL 3.3, the version naming was messy for both of them, but from OpenGL 3.3, the naming started to be clean
© 2022 - 2025 — McMap. All rights reserved.