开发者

iPhone, float textures

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开发者_StackOverflow中文版 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜