title: Textured points in OpenGL ES 2.0?
body: <p>I'm trying to implement textured points (e.g. point sprites) in OpenGL ES 2.0 for a particle system.   Problem I'm having is the points all render as solid black squares, rather than having the texture properly mapped.   </p>
  
  <p>I have verified that gl_PointCoord is in fact returning x/y values from 0.0 to 1.0, which would map across the entire texture.   The texture2D call always seems to return black though.    </p>
  
  <p>My vertex shader : </p>
  
  <pre><code>attribute vec4 aPosition;
  attribute float aAlpha;
  attribute float aSize;
  varying float vAlpha;
  uniform mat4 uMVPMatrix;
  
  void main() {
    gl_PointSize = aSize;
    vAlpha = aAlpha;
    gl_Position = uMVPMatrix * aPosition;
  }
  </code></pre>
  
  <p>And my fragment shader : </p>
  
  <pre><code>precision mediump float;
  uniform sampler2D tex;
  varying float vAlpha;
  
  void main () {
      vec4 texColor = texture2D(tex, gl_PointCoord);
      gl_FragColor = vec4(texColor.rgb, texColor.a * vAlpha);
  }
  </code></pre>
  
  <p>The texture in question is 16x16.   I am able to successfully map this texture to other geometry, but for some reason not to points. </p>
  
  <p>My platform is a Motorola Droid, running Android 2.2.</p>