0

我的游戏在许多设备(Galaxy Nexus、Nexus 7 等)上运行良好,但在其他设备(Galaxy Note 10.1、Galaxy S2)上存在一些问题。它是用 Java、OpenGL ES 2.0、Android 2.2+ 编写的

一些三角形没有显示,如您在这张图片中看到的:

错误 http://img16.imageshack.us/img16/3765/zxuv.png

什么可能导致这个问题?有没有人有这样的问题?我没有这些设备,所以我无法测试...

谢谢。

这是道路渲染中的一些代码:

GLES20.glDisable(GLES20.GL_BLEND);

GLES20.glEnable(GLES20.GL_DEPTH_TEST);
GLES20.glDepthFunc(GLES20.GL_LEQUAL);
GLES20.glDepthMask(true);

GLES20.glDisable(GLES20.GL_CULL_FACE);

...

vertex_position_handle = GLES20.glGetAttribLocation(program, "vertex_position");
GLES20.glEnableVertexAttribArray(vertex_position_handle);
GLES20.glVertexAttribPointer(vertex_position_handle, 3, GLES20.GL_FLOAT, false, 3 * 4, vertex_buffer);

...

GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 6 * line_cnt);

...

GLES20.glDisableVertexAttribArray(normal_handle);
GLES20.glDisableVertexAttribArray(texture_coordinate_handle);
GLES20.glDisableVertexAttribArray(vertex_position_handle);
4

0 回答 0