hi i’m porting my simple videogame based of open gl es 2 in a different smartphone (galaxy j7):
it works fine with Galaxy note 2 (open gl es 2 and android 4.2) , bad in Galaxy j7 (open gl es 3.1 and android 7)
when I draw two geometries 3D one above the other something goes wrong
I’ve posted the bad effect in this video youtube (look for with google) youtu.be/xJHfKASQ-7k
while this is a screeshot about note2 in youtu.be/ERljT0O3vW4
i use the code
glView = new GLSurfaceView(this);
glView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
and every 30 mills I call glView.requestRender()
Perhaps in android 7 rendermode_with_dirty
doesn’t work? or different settings/instruction open gl are needed?
1)in the draw method of the game loop
GLES20.glClearColor(0, 0, 0, 1);
GLES20.glEnable(GLES20.GL_DEPTH_TEST);
GLES20.glClearDepthf(1.0f);
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
(draw goemetries)
GLES20.glFlush();
2)for each geometry 3d I do
GLES20.glEnable(GLES20.GL_CULL_FACE);
GLES20.glDisable(GLES20.GL_BLEND);
GLES20.glDepthMask(true);
(load program -shader etc - etc…)
GLES20.glDisable(GLES20.GL_CULL_FACE);