title: Issues when processing an image using OpenGL ES 2.0
body: <p>I made a simple app that takes an input image and outputs a processed one using a fragment shader. When using a 2^n image it's OK. But if I use a rectangular not-power-of-2 image I get a black stitch running from top to bottom.</p>
  
  <p>This is the original:</p>
  
  <p><img src="https://i.stack.imgur.com/zDN6t.png" alt="enter image description here"></p>
  
  <p>This is after being processed:</p>
  
  <p><img src="https://i.stack.imgur.com/wXbpG.png" alt="enter image description here"></p>
  
  <p>Here's my fragment shader:</p>
  
  <pre><code>precision mediump float;
  uniform vec2 uSize;
  uniform sampler2D sTexture;
  void main()
  {
      gl_FragColor = texture2D(sTexture, vec2(gl_FragCoord) / uSize)
  }
  </code></pre>
  
  <p>Where, uSize is a vec2 having the size of the image</p>
  
  <p>Generally I can work with a power-of-2 textures, but as OGLES2 supports rectangular textures I was thinking of sparing myself some work.</p>
  
  <p>Thanks!</p>
  
  <h1>UPDATE</h1>
  
  <p>Here go my vertices:</p>
  
  <pre><code>static GLfloat vVertices[] =
      {
       -1.0f,  1.0f, 0.0f,
       -1.0f, -1.0f, 0.0f,
        1.0f, -1.0f, 0.0f,
  
        1.0f, -1.0f, 0.0f,
        1.0f,  1.0f, 0.0f,
       -1.0f,  1.0f, 0.0f,
      };
  </code></pre>
  
  <p>And here is the vertex shader:</p>
  
  <pre><code>attribute vec4 vPosition;
  void main()
  {
     gl_Position = vPosition;
  }
  </code></pre>
  
  <h1>UPDATE</h1>
  
  <p>Now, that's strange. Here are the two triangles rendered separately (first using the first 3 vertices, and then using the next (last) three).</p>
  
  <p>Here go for the square image (as expected):</p>
  
  <p><img src="https://i.stack.imgur.com/9cdVQ.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/Q2K4v.png" alt="enter image description here"></p>
  
  <p>And here are how the same triangles look for the rectangle image/texture. They look <em>bizarre</em>:</p>
  
  <p><img src="https://i.stack.imgur.com/Iq6J1.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/WSDvH.png" alt="enter image description here"></p>
  
  <p>They don't look like triangles at all. Does anyone know what's happening?</p>