문제

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.

도움이 되었습니까?

해결책

Found it:

glEnable(GL_POINT_SPRITE_OES);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top