title: Android/OpenGles drawing 2 external texture each taking half of the screen. Left and right half
body: <p>I have successfully bind 2 external OES texture to my shader. Now I want each texture to take 1/2 of the screen(Left for one texture right for another). How do I go about doing it? Example:
  <a href="http://vicceskep.hu/kepek/vicces_funny_007445.jpg" rel="nofollow noreferrer">http://vicceskep.hu/kepek/vicces_funny_007445.jpg</a> 
  random image from google</p>
  
  <p>Showing a full picture of each picture. It will be nice to have an efficient method to do it. The code that I am currently referencing from is the bikflake/ grafika code from github.
  Visit <a href="http://bigflake.com/mediacodec/CameraToMpegTest.java.txt" rel="nofollow noreferrer">http://bigflake.com/mediacodec/CameraToMpegTest.java.txt</a>
  To check the code out.</p>
  
  <p>Okay I think i will really give in depth clarification for my question as I do not have much knowledge about 3d projections in open GL. Sorry for the numerous edits on the question.
  This is my Vertex Shader code currently</p>
  
  <pre><code>    private static final String VERTEX_SHADER =
  
          // UMVPMATRIX IS AN IDENTITY MATRIX
          "uniform mat4 uMVPMatrix;\n" +
          //These are surfacetexture.getTransformationMatrix
          "uniform mat4 uSTMatrixOne;\n" +
          "uniform mat4 uSTMatrixTwo;\n" +        
  
          "attribute vec4 aPosition;\n" +
          "attribute vec4 aTextureCoord;\n" +
  
          "varying vec2 vTextureCoord;\n" +
          "varying vec2 vTextureCoordTwo;\n" +
          "void main() {\n" +
          "    gl_Position =  uMVPMatrix * aPosition;\n" +
          "    vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
          "    vTextureCoordTwo = (uSTMatrixTwo* aTextureCoord).xy ;\n" +
          "}\n";
  </code></pre>
  
  <p>This is my Fragment Shader code currently which does a overlay currently.</p>
  
  <pre><code>        private static final String FRAGMENT_SHADER =
          "#extension GL_OES_EGL_image_external : require\n" +
          "precision mediump float;\n" +      // highp here doesn't seem to matter
          "varying vec2 vTextureCoord;\n" +
          "varying vec2 vTextureCoordTwo;\n" +
          "uniform samplerExternalOES sTextureOne;\n" +
          "uniform samplerExternalOES sTextureTwo;\n" +
  
          "void main() {\n" +
          "    lowp vec4 pixelTop = texture2D(sTextureOne, vTextureCoord);\n" +
          "    lowp vec4 pixelBot  = texture2D(sTextureTwo, vTextureCoordTwo);" +
  
                  "    gl_FragColor = pixelTop + pixelBot;\n" +
          "}\n";
  </code></pre>
  
  <p>As for the aPosition and the a texture coordinate it is currently referenced from. It would be nice if someone explained how mTraingleVerticesData works too.</p>
  
  <pre><code>    private final float[] mTriangleVerticesData = {
  
          // X, Y, Z, U, V
          -1.0f, -1.0f, 0, 0.f, 0.f,
           1.0f, -1.0f, 0, 1.f, 0.f,
          -1.0f,  1.0f, 0, 0.f, 1.f,
           1.0f,  1.0f, 0, 1.f, 1.f,
  };
      GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
              TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
      checkGlError("glVertexAttribPointer maPosition");
      GLES20.glEnableVertexAttribArray(maPositionHandle);
      checkGlError("glEnableVertexAttribArray maPositionHandle");
  
      mTriangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET);
      GLES20.glVertexAttribPointer(maTextureHandle, 2, GLES20.GL_FLOAT, false,
              TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
  </code></pre>
  
  <p>My 2 external projection binding currently</p>
  
  <pre><code>    GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
      GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureID);
  
      //Cam Code
      //Set texture to be active
      GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
      GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTwoTextureID);
  </code></pre>