i'm just starting out with geometry shaders, so i have this:
#version 150
#extension GL_EXT_geometry_shader4: enable
layout(triangles) in;
layout(triangle_strip , max_vertices=3) out;
uniform mat4 View;
uniform mat4 Proj;
void main(){
for(int i=0;i<gl_VerticesIn;i++){
gl_Position = Proj*View*(gl_in.gl_Position+vec4(60.0,0.0,0.0,0.0));
gl_FrontColor = gl_in.gl_FrontColor;
EmitVertex();
}
EndPrimitive();
for(int i=0;i<gl_VerticesIn;i++){
gl_Position = Proj*View*gl_in.gl_Position;
gl_FrontColor = gl_in.gl_FrontColor;
EmitVertex();
}
EndPrimitive();
return;
}
but it's behaving..weirdly...
essentially, it seem to behave like it end's the geometry shader after the first EndPrimitive() call.
i can swap the two around loops around, and it'll draw the other primitive correctly. it just won't draw them both.
my gpu is an nvidia gtx560m, with the latest 296.10 drivers.