1

I use OpenGL ES 1.1 from native code on Android. In some places, I use glClipPlanef() to clip some things. The code for the clipping is:

GLfloat clip[4] = { 0, -1, 0, 0.2 };
glEnable(GL_CLIP_PLANE0);
glClipPlanef(GL_CLIP_PLANE0, clip);

<draw things>

glDisable(GL_CLIP_PLANE0);

This clips out everything upward on the y-axis.

This works fine when I test on a HTC Gratia (Android 2.2) and on a Galaxy Nexus (Android 4.3).

But, when I test this on a Nexus 4 (Android 4.3), the clipping doesn't work. To make it work there, I have to change the equation parameters to:

GLfloat clip[4] = { -1, 0, 0, -0.02 };

It seems like the X and Y axis are reversed for the clipping on the Nexus 4. All the drawing is still the same as for other devices, this only affects the clipping.

Does anyone know why this happens? Is it something specific for the Adreno 320 GPU in the Nexus 4? How can I properly support all devices, if the clipping works differently on different devices?

Unfortunately, I don't have the possibility to just change to OpenGL ES 2.0, it's too much work at this point in the project. Could this be something in the OpenGL ES 1.1 emulation in Android?

Edit: Just confirmed that the new Nexus 7 (2013 edition) also has the same incorrect clipping issue. It also has the Adreno 320 GPU.

Tomas Skäre
  • 174
  • 5
  • I'm seeing a similar problem with the glFrustumf call instead. Had to slightly change the parameters to get it to work properly. I wonder if the OpenGL ES 1.1 support isn't as great on the newer hardware and might have bugs in it. I tested on a Nexus 7 (2012) and saw the difference between that and code running on a Panasonic FZ-A1 tablet. – Jerr Oct 23 '13 at 18:47
  • I'm seeing exactly the same problem as you on Nexus 7 2013 and Nexus 5. Seems like a driver bug to me, and I don't know how one would detect that it's happening :(. – Ivan Neeson Nov 14 '13 at 23:42
  • I made a bug report on this. I find it strange that I haven't been able to see anyone reporting this before. Bug report is on https://code.google.com/p/android/issues/detail?id=62382 – Tomas Skäre Nov 16 '13 at 21:44

0 Answers0