This commit is contained in:
Luna 2025-04-18 06:18:45 +02:00
commit 9d7a6ec8c0
7 changed files with 301 additions and 0 deletions

9
shaders/fragment.frag Normal file
View file

@ -0,0 +1,9 @@
#version 450
layout(location = 0) in vec3 in_color;
layout(location = 0) out vec4 out_color;
void main()
{
out_color = vec4(in_color, 1.0);
}

BIN
shaders/fragment.spv Normal file

Binary file not shown.

BIN
shaders/vertex.spv Normal file

Binary file not shown.

24
shaders/vertex.vert Normal file
View file

@ -0,0 +1,24 @@
#version 450
// x -> -1 (left) 1(right)
// y -> -1 (top) 1(bottom)
vec2 positions[3] = vec2[](
vec2(0.0, -0.5),
vec2(0.5, 0.5),
vec2(-0.5, 0.5)
);
vec3 colors[3] = vec3[](
vec3(1.0, 0.0, 0.0),
vec3(0.0, 1.0, 0.0),
vec3(0.0, 0.0, 1.0)
);
layout(location = 0) out vec3 in_color;
void main()
{
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
in_color = colors[gl_VertexIndex];
}