Add glTF PBR model loading
[opengl.git] / pbrvert.glsl
1 #version 330
2 in vec3 pos;
3 in vec3 unscaledNormal;
4 in vec2 vTexCoord;
5
6 uniform mat4 model;
7 uniform mat4 view;
8 uniform mat4 projection;
9
10 out vec3 normal;
11 out vec2 texCoords;
12
13 out vec3 lightPos, viewPos, worldPos;
14
15 void main() {
16         texCoords = vTexCoord;
17
18         worldPos = vec3(model * vec4(pos, 1.f));
19
20         normal = mat3(transpose(inverse(model))) * unscaledNormal;
21         
22         gl_Position = projection * view * model * vec4(pos, 1.f);
23 }
24