View Single Post
Old 10-09-08, 08:24 AM   #1
12axing
Registered User
 
Join Date: Mar 2008
Posts: 18
Default GL_EXT_geometry_shader4 glsl -- not working?

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:
Code:
void main()
{
    gl_Position = glModelViewProjectionMatrix * gl_Vertex;
}
dummy geometry shader (primitive type: triangles):
Code:
#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:
Code:
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 ...
12axing is offline   Reply With Quote