CGII/framework/shader/plot/glsl/plot2d_line.glgs
2018-05-17 16:01:02 +02:00

33 lines
No EOL
556 B
Text

#version 150 compatibility
#extension GL_EXT_geometry_shader4 : enable
uniform vec3 line_color;
uniform vec3 stick_color;
uniform bool show_lines;
uniform bool show_sticks;
in vec4 base_pos[];
out vec3 color;
void main()
{
if (show_lines) {
color = line_color;
gl_Position = gl_PositionIn[0];
EmitVertex();
gl_Position = gl_PositionIn[1];
EmitVertex();
EndPrimitive();
}
if (show_sticks) {
color = stick_color;
gl_Position = base_pos[0];
EmitVertex();
gl_Position = gl_PositionIn[0];
EmitVertex();
EndPrimitive();
}
}