Sign in to follow this  
Caste

OpenGL Floating point texture on iPhone GLES 2.0

Recommended Posts

Hi everyone,

I'm trying to use a float image as OpenGL texture in an iPhone app. The float data is computationally generated, real 32bit floats.
Now according to the supported extension [url="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"]OES_texture_float[/url] I should be able to use GL_FLOAT as type parameter for my texture. But I cannot find which internalformat types are allowed for glTexImage2D that would suit a float texture.

[code]
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, size.width, size.height, 0, GL_RGB, GL_FLOAT, imageTileData);


[/code]


I've tried GL_RGB and GL_RGBA for both format fields, but can't find equivalents for GL_RGB32F which would be what I intend to use. glGetError returns a GL_INVALID_VALUE.
My whole setup works with non-float textures btw, so it's really the GL_FLOAT and format combination that causes the error.

Any ideas? Thx in advance!

Share this post


Link to post
Share on other sites
No, GL_FLOAT_OES is not available, but according to the spec it is not needed (or not even valid).

[code]
New Tokens:
Accepted by the <type> parameter of TexImage2D, TexSubImage2D, TexImage3D, and TexSubImage3D:
HALF_FLOAT_OES 0x8D61
FLOAT 0x1406
[/code]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this