Reputation: 14435
I'm drawing particles using
glDrawElements(GL_POINTS, count, GL_UNSIGNED_SHORT, 0);
The vertex shader is very simple:
void main()
{
gl_Position = modelViewProjectionMatrix * position;
gl_PointSize = 10.0;
}
The fragment shader tries to use gl_PointCoord
:
void main()
{
gl_FragColor = vec4(gl_PointCoord.s, gl_PointCoord.t, 0.0, 1.0);
}
But the points are always black, so gl_PointCoord
is always (0.0, 0.0)
.
This is on OpenGL ES 2.0, tested on an iPhone 5 and an iPad 3.
Upvotes: 1
Views: 1795