shaders: Implement GLSL shaders for lessons 2-9

This commit is contained in:
2025-06-15 23:30:33 +10:00
parent 1ed13961e8
commit cdf06bfa26
19 changed files with 269 additions and 1 deletions

37
src/shaders/lesson3.glsl Normal file
View File

@@ -0,0 +1,37 @@
/*
* SPDX-FileCopyrightText: (C) 2025 a dinosaur
* SPDX-License-Identifier: Zlib
*/
#version 450
#ifdef VERTEX
layout(location = 0) in vec3 i_position;
layout(location = 1) in vec4 i_color;
layout(location = 0) out vec4 v_color;
layout(set = 1, binding = 0) uniform UBO
{
mat4 u_viewproj;
};
void main()
{
v_color = i_color;
gl_Position = u_viewproj * vec4(i_position, 1.0);
}
#else
layout(location = 0) in vec4 v_color;
layout(location = 0) out vec4 o_color;
void main()
{
o_color = v_color;
}
#endif