opengl-playground/shaders/triangle-gen-geometry.glsl
2020-03-18 22:42:04 +01:00

16 lines
356 B
GLSL

#version 330 core
layout (points) in;
layout (triangle_strip, max_vertices=3) out;
void main()
{
gl_Position = gl_in[0].gl_Position + vec4(-0.1, 0.0, 0.0, 0.0);
EmitVertex();
gl_Position = gl_in[0].gl_Position + vec4(0.0, 0.1, 0.0, 0.0);
EmitVertex();
gl_Position = gl_in[0].gl_Position + vec4(0.1, 0.0, 0.0, 0.0);
EmitVertex();
EndPrimitive();
}