PDA

View Full Version : GL_EXT_geometry_shader4 glsl -- not working?


12axing
10-09-08, 09:24 AM
I am writing a program using the opengl 2.1 api, and wanted to use the extension GL_EXT_geometry_shader4 to write a dummy geometry shader in glsl, which only copies the vertices from the input -- but the screen remains black, althought no errors occure during shader compilation, and both vertex and fragment shader work fine, if I don't use the geometry shader :(

dummy vertex shader:

void main()
{
gl_Position = glModelViewProjectionMatrix * gl_Vertex;
}

dummy geometry shader (primitive type: triangles):

#extension GL_EXT_geometry_shader4 : enable

void main()
{
int i=0;
for(;i<gl_VerticesIn;++i)
{
gl_Position = gl_PositionIn[i];
EmitVertex();
}
EndPrimitive();
}

dummy fragment shader:

void main()
{
gl_FragColor = vec4(0,1,0,0);
}


What could be the reason, why the screen remains black, althought green triangles should appear on the screen? I am using the geforce 280 gtx graphic card with the latest drivers installed ...