ttt3d/assets/shaders/vertex_shader.glsl
Nicolás A. Ortega Froysa 5405063f28 Prepared better shaders.
2018-12-17 15:38:39 +01:00

21 lines
458 B
GLSL

#version 330 core
layout(location = 0) in vec3 vert_pos;
layout(location = 1) in vec3 vert_norm;
uniform vec3 col;
uniform vec3 light_col;
uniform mat4 model;
uniform mat4 view;
uniform mat4 proj;
out vec3 frag_pos;
out vec3 frag_col;
out vec3 normal;
void main() {
gl_Position = model * view * proj * vec4(vert_pos, 1);
frag_pos = vec3(model * vec4(vert_pos, 1.0));
frag_col = col * light_col;
normal = mat3(transpose(inverse(model))) * vert_norm;
}