vulkan-tutorial/shadersrc/rainbow.vert

21 lines
384 B
GLSL
Raw Permalink Normal View History

2022-07-12 17:03:07 +00:00
#version 450
2022-12-03 07:41:13 +00:00
layout(location = 0) out vec4 fragColor;
2022-07-12 17:03:07 +00:00
vec2 positions[3] = vec2[](
vec2(0.0, -0.5),
vec2(0.5, 0.5),
vec2(-0.5, 0.5)
);
2022-12-03 07:41:13 +00:00
vec4 colors[3] = vec4[](
vec4(1.0, 0.0, 0.0, 1.0),
vec4(0.0, 1.0, 0.0, 1.0),
vec4(0.0, 0.0, 1.0, 1.0)
2022-07-12 17:03:07 +00:00
);
void main() {
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
fragColor = colors[gl_VertexIndex];
}