iPhone, float textures

做~自己de王妃 提交于 2019-12-05 18:32:02

Sadly, OpenGL ES treats the parameters to glTex(Sub)Image* differently from desktop OpenGL.

In desktop OpenGL, what defines the actual format of the texture is the internalformat. In GL ES 2.0, it is the format and type values that define this. So if you upload a (GL_RGBA, GL_UNSIGNED_BYTE) texture, that's the equivalent of using GL_RGBA8 as the internal format.

What this means is that, if you want a floating-point texture, you use (GL_RGBA, GL_FLOAT) as the format and type parameters. It's a pointless inconsistency between the two specifications.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!