qt6windows7/tests/manual/rhi/geometryshader/test.geom
2023-10-29 23:33:08 +01:00

27 lines
442 B
GLSL

#version 430
# define M_PI 3.14159265358979323846
layout(points) in;
layout(line_strip, max_vertices = 7) out;
layout(std140, binding = 0) uniform buf {
float radius;
};
void main(void)
{
for(int i=0;i<7;++i)
{
float theta = float(i) / 6.0f * 2.0 * M_PI;
gl_Position = gl_in[0].gl_Position;
gl_Position.xy += radius * vec2(cos(theta), sin(theta));
EmitVertex();
}
EndPrimitive();
}