White OpenGL ES 1 pot textures on Galaxy Nexus

402 views Asked by At

It seems my power-of-2 textures show up completely white. This application works on various devices, even Nexus 7 but Galaxy Nexus phone seems to produce white textures. This is probably related to PowerVR gpu.

I can interact with the app, everything seems in-place but the textures aren't rendering.

I've tried various EGLConfigs and it seems that nothing works.

Here is how I generate my textures, notice no mipmaps:

glGenTextures( 1, &TextureId );
glBindTexture( GL_TEXTURE_2D, TextureId );
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );

glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,Width,Height,0,GL_RGBA,GL_UNSIGNED_BYTE,Data);

Also, GL_TEXTURE_2D is enabled.

  • Textures are all power of 2 (64x512,1024x1024 etc).
  • None of the textures exceed 1024x1024 even though device supports 2048x2048
  • There are no glError()s and no eglError()s.
  • Color works and I can interact with my app
  • There are no errors with eglMakeCurrent or eglCreateContext
  • Works on all other devices I've tried with (emulator,Nexus 7(Tegra),Sony Xperia 10(Adreno 200),Galaxy S2(Mali GPU))
  • I use interleaved VBO for drawing
  • glEnable(GL_TEXTURE_2D); is set
  • Assets are placed in the assets folder
  • All OpenGL operations occur on the same context and thread

UPDATE: glGenTextures() returns huge numbers.

Rolling a custom texture iterator, I was able to get it working. I would still like to figure out why glGenTextures doesn't work. Here is the code:

GLuint TextureId;
glGenTextures( 1, &TextureId );

TextureId can be in billions. This only happens on Nexus Phone, all of the other devices gave me correct texture ids (1,2,3,4,etc..)

Any suggestions?

0

There are 0 answers