Android OpenGL ES Issues
Android OpenGL ES Issues
OmniG Software Inc. (www.omnigsoft.com) Monday, January 21, 2008 Contact: [email protected]
This document lists all issues we got during the development of OmniGSoft X-Benchmark for Android. X-Benchmark is a comprehensive mobile performance benchmark, which tests the most important capabilities of a mobile device, including: processor, memory, I/O, 2D graphics, 3D graphics. While developing the 3D graphics test module for Android OpenGL ES implementation, we got several issues in OpenGL ES. The issues listed here are based on X-Benchmark running on the latest Android SDK (android_sdk_windows_m3-rc37a.zip). We also include the test result of X-Benchmark Java ME edition running on Sun Wireless Toolkit 2.5 with Sun OpenGL ES implementation (JSR-239 Java Binding for OpenGL ES). All Android OpenGL ES issues listed here are concluded from comparison between Android OpenGL ES test results and Sun OpenGL ES test results. However, they are still not finally confirmed, which means: 1. The issue could be a bug in Android OpenGL ES implementation. 2. This issue might be caused by improper usage of OpenGL ES functions, such as incorrect function parameters.
If remove glFogf() calling, the OpenGL works, but not sure what kind of fog formula is used.
When using glTexImage2D() with GL_LUMINANCE_ALPHA, the 3D object disappears in 3D rendering on Android emulator, while Sun JSR-239 generates correct rendering. In the following screenshots, the red translucent trees are generated by an image with luminance intensity applied on a 3D chip.
gl.glTexImage2D( GL10.GL_TEXTURE_2D, 0, GL10.GL_LUMINANCE_ALPHA, width, height, //Image width and height 0, GL10.GL_LUMINANCE_ALPHA, GL10.GL_UNSIGNED_BYTE, texBuf ); gl.glTexEnvx(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_BLEND);
Android OpenGL ES
gl.glTexEnvx(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, (isLightingEnabled?GL10.GL_MODULATE : GL10.GL_REPLACE)); if(isLightingEnabled) //lighting { gl.glEnable(GL10.GL_LIGHTING); gl.glMaterialxv(face, GL10.GL_AMBIENT, OpenGLUtil.getColorxv(_mtlColor, texture!=null?255:_mtlTransparency), 0); gl.glMaterialxv(face, GL10.GL_DIFFUSE, OpenGLUtil.getColorxv(_needTextureMaps?(lumiCol != Color.BLACK?Color.BLACK:Color.WHITE):(_mtlColor), _mtlTransparency), 0); gl.glMaterialxv(face, GL10.GL_SPECULAR, OpenGLUtil.getColorxv(specularCol, 0), 0); gl.glMaterialx(face, GL10.GL_SHININESS, 100); gl.glMaterialxv(face, GL10.GL_EMISSION, OpenGLUtil.getColorxv(lumiCol, 0), 0); } else //No lighting { gl.glDisable(GL10.GL_LIGHTING); int[] colV = OpenGLUtil.getColorxv(_mtlColor, _mtlTransparency); gl.glColor4x(colV[0], colV[1], colV[2], colV[3]); //Set the current color }
Android OpenGL ES
gl.glMatrixMode(GL10.GL_TEXTURE); if(envmap != null)//Need transform environment mapping { matTexture.setIdentity(); matTexture.setRotation(_objMat_camera); OpenGLUtil.setCurrentMatrix(gl, matTexture); }
Issue 8: Android OpenGL initialization takes very long time on Android emulator
The following code for OpenGLContext acquisition:
OpenGLContext staticGlc = new OpenGLContext(OpenGLContext.DEPTH_BUFFER);
Issue 9: glTexImage2D() takes too much time to load a texture onto OpenGL video memory
We use the following code to load texture onto OpenGL video memory:
gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, texureWidth, texureHeight, 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, texureBuf);
It seems like function glTexImage() takes long time to load a texture onto OpenGL video memory, which makes a 3D initialization of a 3D application or game very slow.