hi all,
I am trying to render points. The rendering works fine if i don’t use the passthrough geometry shader. I am trying to make it work with the passthrough geometry shader but i get an error (1282) Invalid operation after the call to
glDrawArrays(GL_POINTS,0,vertices.size());
This is my geometry shader. Note that the vertex shader is already giving the pos in clipspace (multiply by MVP).
#version 330
layout (points) in;
layout (points) out;
layout (max_vertices = 3) out;
void main(void)
{
for (int i = 0; i < gl_in.length(); i++) {
gl_Position = gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}
Am I missing anything here? I have tried to render triangles using the same geometry shader (but with the first two layouts changed to
layout(triangles) in;
layout(triangle_strip) out;
and replaced the draw call to glDrawElements and it works fine. Why doesn’t it work with points?