#version 450

layout(location = 0) in vec3 pos;
layout(location = 1) in vec2 tex;
layout(location = 2) in vec3 norm;
layout(location = 3) in vec3 tang_U;
layout(location = 4) in vec3 tang_V;

layout(location = 5) in mat4 model_t;
/* 5 <- 6, 7, 8 */
layout(location = 9) in mat3 normal_t;
/* 9 <- 10, 11 */

layout(location = 0) out vec3 out_norm;
layout(location = 1) out vec3 out_tang_U;
layout(location = 2) out vec3 out_tang_V;
layout(location = 3) out vec2 out_tex;
layout(location = 4) out vec3 out_pos;

layout(push_constant, std430) uniform pc {
    mat4 proj_cam_t;
};

void main(){
    out_norm = normalize(normal_t * norm);
    out_tang_U = normalize(normal_t * tang_U);
    out_tang_V = normalize(normal_t * tang_V);
    out_tex = tex;
    vec4 real_pos = model_t * vec4(pos, 1);
    out_pos = real_pos.xyz;
    gl_Position = proj_cam_t * real_pos;
}