Hello
I have made a simple geometry shader,
but it doesn’t work correct.
The first example runs correct, but with the second,
i see nothing :
First example (runs correct):
[b]#version 420 core
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
in vec4 color[];
out vec4 col;
out gl_PerVertex
{
vec4 gl_Position;
}vertexOut;
void main()
{
for(int i=0; i<3; i++)
{
gl_Position = gl_in[i].gl_Position;
/*vertexOut.gl_Position = vec4(gl_in[i].gl_Position); */
col = color[i];
EmitVertex();
}
EndPrimitive ();
}[/b]
Second example (see nothing on the screen):
[b]#version 420 core
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
in vec4 color[];
out vec4 col;
out gl_PerVertex
{
vec4 gl_Position;
}vertexOut;
void main()
{
for(int i=0; i<3; i++)
{
/* gl_Position = gl_in[i].gl_Position; */
vertexOut.gl_Position = vec4(gl_in[i].gl_Position);
col = color[i];
EmitVertex();
}
EndPrimitive ();
}
[/b]
I can’t found the error in the code. What can it be?
Bye