問題描述
盡管搜索了數小時,但我似乎無法找到明確的答案.有人可以告訴我發生了什么嗎?我收到諸如不支持版本 140"之類的錯誤消息.這是我的設備(Kindle Fire)還是 GL ES 2.0?我需要添加庫嗎?
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?
推薦答案
其實你不需要添加任何庫,140 對 Kindle Fire 來說太新了.刪除版本規范或遞減它,直到著色器編譯.您可能需要修復著色器中的一些其他錯誤,因為語言的各個版本確實存在一些差異.
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.
您還可以使用 glGetString()
查詢 GL_SHADING_LANGUAGE_VERSION
以獲取您的設備支持的 GLSL 版本(保證至少為 100 - ES 2.0 是第一個一個帶有陰影語言的).
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).
另外,正如其他人所提到的,OpenGL ES GLSL 與 OpenGL ES 不是同一種語言(我認為這很明顯,OpenGL ES 不是 OpenGL),因此版本號將不匹配.但是有 GL_ARB_ES2_compatibility 及其對 ES3、ES3.1 和 ES3 的擴展.2,其中描述了 ES/非 ES GLSL 語言的映射,并且使用這些語言可以在非 ES 上下文中獲得類似 ES 的功能.
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.
這篇關于我可以在 OpenGL ES 2.0 中使用哪些版本的 GLSL?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!