iPhone, float textures

柔情痞子 提交于 2019-12-07 13:43:07

问题


I need to have GL_RGBA32F as internal format, but i do not get this in OpenGL ES implementation. Instead of this i get only GL_FLOAT as a texture data type. The OES_texture_float spec has nothing to say what's inside. So i do not know, whether my texture data will be normalized to [0, 1] or not. Basically i need to store in texture unclamped texture data regardless it's float or integer value. How i can get not normalized data inside my texture?


回答1:


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.



来源:https://stackoverflow.com/questions/7313224/iphone-float-textures

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