initial commit

This commit is contained in:
ZY4N
2024-12-10 13:50:21 +01:00
parent 20bbd06a89
commit 275d47b7c6
33 changed files with 1066 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
layout (location = 0) uniform mat4 mvp_matrix;
layout (location = 0) in vec3 vertex_position;
#ifdef LIGHTING
layout (location = 1) uniform mat4 model_matrix;
layout (location = 1) in vec3 vertex_normal;
layout (location = 0) out vec3 frag_position;
layout (location = 1) out vec3 frag_normal;
#endif
#ifdef TEXTURE
layout (location = 2) in vec2 vertex_tex_coord;
layout (location = 2) out vec2 frag_tex_coord;
#endif
void main() {
gl_Position = mvp_matrix * vec4(vertex_position, 1.0);
#ifdef LIGHTING
frag_position = (model_matrix * vec4(vertex_position, 1.0)).xyz;
frag_normal = normalize(mat3(model_matrix) * vertex_normal);
#endif
#ifdef TEXTURE
frag_tex_coord = vertex_tex_coord;
#endif
}