Question

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.

Was it helpful?

Solution

Found it:

glEnable(GL_POINT_SPRITE_OES);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top