~vladh/peony

peony/src_shaders/base.vert -rw-r--r-- 475 bytes
7fc9922bVlad-Stefan Harbuz changes shaders namespace into class a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
  Peony Game Engine
  Copyright (C) 2020 Vlad-Stefan Harbuz <vlad@vladh.net>
  All rights reserved.
*/

uniform mat4 model_matrix;
uniform mat3 model_normal_matrix;

layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec2 tex_coords;

out BLOCK {
  vec3 normal;
} vs_out;

void main() {
  gl_Position = projection * view * model_matrix * vec4(position, 1.0);
  vs_out.normal = normalize(model_normal_matrix * normal);
}