OpenGL ES texture origin differs from top/left to bottom/left on different phones
I'm currently developing an NDK-based OpenGL ES 2.0 app. And i'm loading textures using libjpeg flipping it vertically (as OpenGL standard says). It works fine on Samsung Galaxy SII, HTC Desire HD and so on (+ Windows's SDL implementation). But on some phones (like Samsung Galaxy S GT-I9000 by reports from Android Market users) there is an old Android-specific issue with orign located at the top/left side of the image, not the bottom/left. How can i determine, should i flip textures or not at a runtime?
I thought about rendering some test pattern to the texture and then analizing output, but it's too complex workaround. 开发者_JAVA百科There must be some easier way.
Thanks!
Looks like i've fixed this problem myself. I've started using compressed ETC1 textures instead of uncompressed ones and that helped to fix this strange issue.
i want to ask you about your issue...
i am having some problems loading textures on gt-i9000 device and all other devices that use the PowerVR SGX540 or PowerVR SGX530 gpu.
I am using the ETC textures. They work on all other devices but on these devices some textures are like black...
Are theer any specific setting sthat you are using in you glTexParameterf(...) functions ?
I am using these :
gl.glActiveTexture(GL10.GL_TEXTURE0);
gl.glBindTexture(GL10.GL_TEXTURE_2D, glTextureId);
gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR);
gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
精彩评论