A 3D game engine from scratch.
1// (c) 2020 Vlad-Stefan Harbuz <vlad@vladh.net>
2
3uniform mat4 model_matrix;
4uniform mat3 model_normal_matrix;
5
6layout (location = 0) in vec3 position;
7layout (location = 1) in vec3 normal;
8layout (location = 2) in vec2 tex_coords;
9
10out BLOCK {
11 vec3 normal;
12} vs_out;
13
14void main() {
15 gl_Position = projection * view * model_matrix * vec4(position, 1.0);
16 vs_out.normal = normalize(model_normal_matrix * normal);
17}