qt6windows7/tests/manual/rhi/geometryshader/test.geom

27 lines
442 B
Plaintext
Raw Normal View History

2023-10-30 06:33:08 +08:00
#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();
}