Imagination PowerVR SDK Blog

Texture loading problem PowerVR SGX540... HELP!!!!


#1

Hi


I am working on a 3d game for android and it is currently in the market.
https://play.google.com/store/apps/details?id=render6d.quake3.activity 

It uses compressed ETC textures mostly. 

My users have have tested this app. on many different devices with Adreno-200, Adreno-205, Mali-400MP, gpus 
It is working fine there…

But any device using PowerVR SGX540 GPU will not load many textures correctly…
And some textures are loaded completely black while others are loaded correctly…

I have made sure that all my textures are power-of-two,
but some are not square and can be rectangular e.g.  64*128.

Why am i having this problem, please help!!!

I use the following opengl Paramters when loading the textures:

<pre =“lang-c prettyprint” style="margin-top: 0px; margin-bottom: 10px; padding: 5px; border: 0px; font-size: 14px; vertical-align: line; : rgb238, 238, 238; font-family: Consolas, Menlo, Monaco, ‘Lucida Console’, ‘Liberation Mono’, ‘DejaVu Sans Mono’, ‘Bitstream Vera Sans Mono’, ‘Courier New’, monospace, serif; overflow: auto; width: auto; max-height: 600px; line-height: 18px; "><span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">glActiveTexture<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">(<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE0<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">);<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">              
gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">glBindTexture<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">(<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_2D<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> glTextureId<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">);<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">
gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">glTexParameterf<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">(<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_2D<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_MIN_FILTER<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_LINEAR<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">);<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">
gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">glTexParameterf<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">(<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_2D<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_MAG_FILTER<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_LINEAR<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">);<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">
gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">glTexParameterf<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">(<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_2D<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_WRAP_S<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_CLAMP_TO_EDGE<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">);<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">
gl<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">glTexParameterf<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">(<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_2D<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_TEXTURE_WRAP_T<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">,<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; "> GL10<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">.<span =“pln” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">GL_CLAMP_TO_EDGE<span =“pun” style="margin: 0px; padding: 0px; border: 0px; vertical-align: line; : transparent; ">);

#2

Hi tanali,

Have you tried testing your application with all textures forced to square power-of-two to see if this resolves the rendering issues? Are you certain that the non-square power-of-two textures are the cause of the problem?

Thanks,
Joe