Imagination PowerVR SDK Blog

PowerVR SGX540 OpenGL ES 1.1 FBO npot textures


#1

Hello,





I wrote application that renders to FBO (texture as color attachment, renderbufferobject as depth attachment). I’ve tried using npot texture with mipmap 0 as color attachment for rendering full screen quad but when checking if FBO is complete it fails and fails when creating color attachment as texture for that FBO. I’m developing on Android 4.0 Galaxy Nexus with PowerVR SGX 540_120 chip on board. Sources of Android 4.0 are from Google site, also drivers (binaries) for PowerVR SGX 540_120 are from Google site ? I read on forum that OpenGL ES 2.0 has support for Npot textures ??


What about OpenGL ES 1.1 ?


#2

Also I forget to mention that I use GL_CLAMP_TO_EDGE as texture wrap mode.


#3

Hi CrossImgtec,

OpenGL ES 1.1 does not have core support for npot textures.
You have to check for the texture_npot extension before using them.

OpenGL ES 2.0 does support npot textures but please be aware that there are limitations when it comes to texture filtering for npot textures.

Regards,
Marco




#4

I’m currently struggling through this as well. Can you explain what the limitations are? I can’t find any documentation that explains what to do to make NPOT support reliable.


#5

The best documentation to look at are the ES 1.1 and ES 2.0 specifications
http://www.khronos.org/registry/gles/
and the online man-pages
http://www.khronos.org/opengles/sdk/1.1/docs/man/
http://www.khronos.org/opengles/sdk/docs/man/

The one for ES2.0 states for glTexParameter the following:
“Similarly, if the width or height of a texture image are not powers of two and either the GL_TEXTURE_MIN_FILTER is set to one of the functions that requires mipmaps or the GL_TEXTURE_WRAP_S or GL_TEXTURE_WRAP_T is not set to GL_CLAMP_TO_EDGE, then the texture image unit will return (R, G, B, A) = (0, 0, 0, 1).”
       
Regards,
Marco





#6

Hi all,

i’m also using FBO and followed all provided information you gave in that forum.
My texture is 1024x1024 and is a EGLImage obtained from an Android native buffer.

All the FBO setup is fine (i checked the status and glError at each step and there is no error).

The problem is that nothing is drawn in my texture.

For information i tried on another mobile with different GPU and it is working fine. But one of the major diff is that on PowerVR SGX540 is not supporting npot_texture extension while the other ones yes.

For the moment i conclude that i’m certainly missing a configuration but i don’t find which one.
Texture parameters are:
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
   
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

texture size is 1024x1024 format is RGB565

Any idea on possible missing configuration.

Thanks a lot for your help.

BR

Seb




#7

We’ve found that some devices don’t support framebuffer formats other than RGBA. Don’t remember if that’s the case for PowerVR, but FYI. We only ever use RGBA as a result.


#8

is there a way to detect if FBO + RGB is supported or not before seeing that it is not working ?
BR

Seb