Is it possible to derive a new primitive type from a geometric shader, except for input? I would like to enter a point and display a triangle. The point will be used as the center of this triangle. If not, is there another way to enter only a point and display another part of the geometry defined by that point?
With the answer here, the geometric shader does only what I requested (if anyone ever needed):
#version 120
#extension GL_EXT_geometry_shader4 : enable
layout(points) in;
layout(triangle_strip) out;
void main()
{
gl_Position = gl_in[0].gl_Position;
EmitVertex();
gl_Position = gl_in[0].gl_Position+vec4(1,0,0,0);
EmitVertex();
gl_Position = gl_in[0].gl_Position+vec4(0, 1, 0, 0);
EmitVertex();
EndPrimitive();
}
Raven source
share