Android OpenGL Texture Scaling Problem

I have a texture with 8 equally sized stripes that I am using as a wall with OpenGL. On my Nexus One (android) it scales it properly, as the stripes get smaller the further away they get ( ).
However, in emulators and on a G1 (android) (and probably on other hardware), it
does not scale properly, as the stripes remain the same width, while
the height scales as it should. ( ).
Is there an option that I need to set that is set to default on my nexus one but not on other platforms?
I can post code if needed, but I figured this would be a simple option/ configuration fix.

Since this is on an Android, you’re using OpenGL ES, which despite the name isn’t the same as OpenGL.

However, it looks very much like what you’re getting is non-perspective correct texturing in the bad one. If GL ES 2.x works like GL 3.x does, this is controlled by the shader. If you declare your input/output between the vertex and fragment shaders to be “noperspective”, then it won’t be perspective correct. “smooth” means perspective-correct, which should be the default.

Well, it’s a “subset” of OpenGL, and based on it, so they should be close enough for this issue.

Thanks for the info, though. That’s much more helpful than googling has been. Hopefully I’ll get this sorted out.


Figured it out. In case anyone else has this issue, here’s the fix:

It’s doing affine texturing, which essentially means, texturing without perspective correction. I’ve never seen any opengl implementation do this :eek: You should not need to use the glHints, since these are hints ONLY and can be totally ignored by the driver. You shouldn’t rely on them. I guess on phones with very limited 3d hardware this insanity is to be expected.