title: OpenGL ES2 Alpha test problems
body: <p>I am rendering in 3D multiple objects with textures that have alpha. All the textures load fine but when I try to render them in front of each other I get the following:</p>
  
  <p><img src="https://i.stack.imgur.com/8cw0Y.png" alt="Left is what I have. Right is what I want"></p>
  
  <p>Left is what I have. Right is what it should be. The grid is just to help visualize the perspective.</p>
  
  <p>The texture in front of the red circle texture is clipped. I searched around for an answer and it says for me to use:</p>
  
  <pre><code>GLES20.glEnable( GLES20.GL_BLEND );
  GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA );
  </code></pre>
  
  <p>But I am using it and it still isn't working. My setup in which I correctly placed in the onSurfaceCreated() function is:</p>
  
  <pre><code>GLES20.glClearColor( 0.75f, 0.85f, 1f, 1.0f );
  GLES20.glEnable( GLES20.GL_BLEND );
  GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA );
  GLES20.glEnable( GLES20.GL_DEPTH_TEST );
  GLES20.glDepthFunc( GLES20.GL_LEQUAL );
  GLES20.glDepthMask( true );
  GLES20.glClearDepthf( 1f );
  </code></pre>
  
  <p>My fragment shader is:</p>
  
  <pre><code>uniform sampler2D texture;
  varying vec2 texCoord;  
  void main(){ 
     gl_FragColor = texture2D( texture, texCoord );
  } 
  </code></pre>
  
  <p>Do I have to include anything in the Android manifest to enable alpha testing? I do not want to end up having to manually organize my polygons or use alpha discard() because I need and want some pixels to be translucent.</p>
  
  <p><strong>How do I get 3D alpha testing depth buffers to work?</strong></p>