Geometrical pass-through shader for points

I'm having trouble writing a simple pass-through geometric shader for points. I decided it should be something like this:

#version 330
precision highp float;

layout (points) in;
layout (points) out;

void main(void)
{
    gl_Position = gl_in[0].gl_Position;
    EmitVertex();
    EndPrimitive();
}

I have a bunch of dots displayed on the screen when I do not specify a geometric shader, but when I try to associate this shader with my shader program, the dots are not displayed and error messages are not reported.

I use C # and OpenTK, but I don't think this is a problem.

Edit: People requested other shaders, although I tested these shaders without using a geometric shader, and they worked perfectly without a geometric shader.

Vertex shader:

void main()
{
    gl_FrontColor = gl_Color;
    gl_Position = ftransform();
}

Fragment Shader:

void main()
{
    gl_FragColor = gl_Color;
}
+3
source share
1 answer

, ( ), . ,

layout (points, max_vertices=1) out;

, , API ( , , ).

EDIT:. gl_FrontColor ( gl_Color ), ( ).

. (, gl_in) (, ftransform ). , , , gl_in gl_Color gl_FrontColor, . out in ( , in ).

+4

All Articles