CGII/framework/shader/plot/glsl/plot1d_bar.glgs

26 lines
629 B
Text
Raw Normal View History

2018-05-17 14:01:02 +00:00
#version 150 compatibility
#extension GL_EXT_geometry_shader4 : enable
uniform float bar_width;
in vec4 colors[];
out vec4 color;
vec4 map_plot_to_screen(in vec2 pnt);
void main()
{
color = colors[0];
gl_Position = map_plot_to_screen(vec2(gl_PositionIn[0].x - 0.5*bar_width, 0.0));
EmitVertex();
gl_Position = map_plot_to_screen(vec2(gl_PositionIn[0].x + 0.5*bar_width, 0.0));
EmitVertex();
gl_Position = map_plot_to_screen(vec2(gl_PositionIn[0].x - 0.5*bar_width, gl_PositionIn[0].y));
EmitVertex();
gl_Position = map_plot_to_screen(vec2(gl_PositionIn[0].x + 0.5*bar_width, gl_PositionIn[0].y));
EmitVertex();
}