nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   Software Development (http://www.nvnews.net/vbulletin/forumdisplay.php?f=53)
-   -   GL_EXT_geometry_shader4 glsl -- not working? (http://www.nvnews.net/vbulletin/showthread.php?t=120823)

12axing 10-09-08 08:24 AM

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 ...


All times are GMT -5. The time now is 08:44 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.