GLSL geometry input/output primitive issue
Posted: Sat Jun 22, 2013 9:16 pm
I've been trying to make use of geometry shaders recently and I've come to notice that only the "triangles" layout appears to work. All other layouts don't render the mesh visible at all. Mind you, I've tried simple pass-throughs for testing purposes.
Vert and frag programs for both:
As triangle:
As line:
Even though these images should be unnecessary, they always make understanding easier:
Triangle
Line
And yes, I have properly set the compile targets and primitive type parameters in my "addHighLevelShaderMaterial" call. I've come to notice that even if I have the primitive type set to something aside from EPT_TRIANGLES and EPT_TRIANGLE_STRIP the triangle code still works. I've even tried a "points" pass-through (uses only 1 vertex) to no avail.
Running Irrlicht 1.8 on a Radeon Sapphire HD 5770.
Regards,
Tannz0rz
Vert and frag programs for both:
Code: Select all
// Vert
void main()
{
gl_Position = ftransform();
}
// Frag
void main()
{
gl_FragColor = vec4(1.0);
}
Code: Select all
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
void main()
{
for(int i = 0; i < 3; i++)
{
gl_Position = gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}
Code: Select all
layout(lines) in;
layout(line_strip, max_vertices = 2) out;
void main()
{
for(int i = 0; i < 2; i++)
{
gl_Position = gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}
Triangle
Line
And yes, I have properly set the compile targets and primitive type parameters in my "addHighLevelShaderMaterial" call. I've come to notice that even if I have the primitive type set to something aside from EPT_TRIANGLES and EPT_TRIANGLE_STRIP the triangle code still works. I've even tried a "points" pass-through (uses only 1 vertex) to no avail.
Running Irrlicht 1.8 on a Radeon Sapphire HD 5770.
Regards,
Tannz0rz