vulkan_test_simple
view vertex.glsl @ 1:d5a3f6912f4d
how the hell did this work?
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 12 Sep 2024 04:19:14 +0300 |
parents | |
children |
line source
1 #version 450
2 #extension GL_ARB_separate_shader_objects : enable
4 out gl_PerVertex {
5 vec4 gl_Position;
6 };
8 layout(location = 0) out vec3 color;
10 vec2 vpos[3] = vec2[](
11 vec2(0.0, -0.5),
12 vec2(0.5, 0.5),
13 vec2(-0.5, 0.5)
14 );
16 vec3 vcol[3] = vec3[](
17 vec3(1.0, 0.0, 0.0),
18 vec3(0.0, 1.0, 0.0),
19 vec3(0.0, 0.0, 1.0)
20 );
22 void main()
23 {
24 gl_Position = vec4(vpos[gl_VertexIndex], 0.0, 1.0);
25 color = vcol[gl_VertexIndex];
26 }