I'm trying to use stencil test in my android opengl application.
The code is pretty usual. Smth like that:
gl.glStencilFunc(GL10.GL_ALWAYS, 1, 0xff);
gl.glStencilOp(GL10.GL_KEEP, GL10.GL_REPLACE, GL10.GL_REPLACE);
//...drawing a thing to stencil buffer
gl.glStencilFunc(GL10.GL_EQUAL, 1, 0xff);
gl.glStencilOp(GL10.GL_KEEP, GL10.GL_KEEP, GL10.GL_KEEP);
//...drawing using stencil buffer bits
But somewhy when I draw to the stencil buffer it is being drawn several times in different places of the screen. I have no idea why. I only draw to the stencil once but it somehow... multiplies... . It's on Sony device. Then i took my chinese tab and ran the app there. I got another picture - it is drawn only once and at the right place, BUT the stencil buffer is being cleared up between the calls of onDrawFrame - despite I DON't DO IT. It's being cleared up by itself.
Any thoughts? Device problems possibly?