Hi everyone, sorry for my English I'm from Ukraine.
I have a question about Adreno 320 and OpenGL FBO.
When I'm using FBO I have a problem to write into full precision float texture ( GL_RGBA32F_EXT ).
Textures creates successfully, color buffer attachment is successfull, GPU Adreno 320 has GL_EXT_COLOR_BUFFER_FLOAT extention. Every things are fine. But when I calling glDrawElements I have a 1282 - Error ( GL_INVALID_OPERATION ). Changing texture to GL_RGBA or GL_RGBA16F_EXT - resolve the problem, but why I can't renderered into GL_RGBA32F_EXT texture?
Exemples of code here:
Texture creation:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_EXT, mWidth, mHeight, 0, GL_RGBA, GL_FLOAT, mImage) ;
FBO creation:
glGenRenderbuffers(1, &mColorRenderBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, mColorRenderBuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, mWidth, mHeight);
glBindRenderbuffer(GL_RENDERBUFFER, 0);
glGenFramebuffers(1, &mFrameBuffer);
glBindFramebuffer(GL_FRAMEBUFFER, mFrameBuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, mColorRenderBuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mID, 0);
All code validates fine glGetError() return 0 for all rows of code.
Error ocurred only when I called:
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_SHORT, NULL);
glGetError() return 1282 (GL_INVALID_OPERATION).
On textures like this all works fine:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_EXT, mWidth, mHeight, 0, GL_RGBA, GL_FLOAT, mImage) ;
or
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, mWidth, mHeight, 0, GL_RGBA, GL_FLOAT, mImage) ;
What wrong with GL_RGBA32F_EXT? If Adreno 320 don't support render to GL_RGBA32F_EXT texture?
Android version was 4.2.2 (API Level 17).
Adreno 320 - GL_EXT_color_buffer_float
Posted: Mon, 2013-10-14 10:05
Hi..
In general in GLES, rendering to floating point textures is not supported (http://www.khronos.org/opengles/sdk/docs/man3/ (glTexImage2D)), however our current Adreno drivers support the GL_EXT_color_buffer_half_float extension which does allow 16bit textures to be rendered to.
-mark
I can see that and GL_EXT_color_buffer_half_float work pretty fine. And very useful for us, Thanks - Adreno 320 is realy very flexible mobile GPU.
But Android program "Hardware Info" sad Adreno 320 has GL_EXT_color_buffer_float extention. Is it true?
Yes..I know this is a bit confusing, so I'll copy the appropriate section from our developer guide (available in our SDK):
Floating Point Textures
Adreno 3xx supports the same texturing features as Adreno 2xx, including:
o Texturing and linear filtering of FP16 textures via the GL_OES_texture_half_float and GL_OES_texture_half_float_linear extension
o Texturing from FP32 textures via GL_OES_texture_float
Through the OpenGL ES 3.0 API, Adreno 3xx also includes rendering support for FP16 (full support) and FP32 (no blending).
The supported extensions for this feature are:
o GL_OES_texture_float
o GL_OES_texture_float_linear
o GL_OES_texture_half_float
o GL_OES_texture_half_float_linear
The GL_OES_texture_float extension API uses a 32-bit floating format, whereas GL_OES_texture_half_float extension API uses a 16-bit format. Many minification and magnification filters, along with GL_NEAREST and GL_NEAREST_MIPMAP_NEAREST, are supported by Adreno 3xx.
How to store 1 channel 32or16 bit float in FBO using OpenGLES on Android such as Qualcomm, arm,etc.