我可以在OpenGL ES 2.0的使用什么版本的GLSL的? [英] What versions of GLSL can I use in OpenGL ES 2.0?

查看:308
本文介绍了我可以在OpenGL ES 2.0的使用什么版本的GLSL的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法找到一个清晰的答案,尽管谷歌搜索的时间。谁能告诉我这是怎么回事?我得到的不支持的版本140。的错误说法之类的东西,这是我的设备(烧火)或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.

您还可以查询 GL_SHADING_LANGUAGE_VERSION 使用 glGetString()来获取版本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 0.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的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆