varying vec2 uv;
varying vec3 vert_position;
varying vec3 normal_vector;

attribute vec2 uv_shader;
attribute vec3 normal;

uniform mat4 model_mat;
uniform mat4 inverse_model_mat;
uniform mat4 rot_from_torque_mat;
uniform mat4 rot_to_torque_mat;
uniform vec3 model_position;

void main() {
    // Actual vertex position has this super ancient but helpful function for us
    gl_Position = ftransform();

    // UV coordinates are also provided
    // uv = gl_MultiTexCoord0.st;
    uv = uv_shader;

    // Normal relative to worldspace, make sure to account for the model rotation
    normal_vector = mat3(inverse_model_mat) * normal;

    // Worldspace position of the vertex
    vert_position = model_position + (inverse_model_mat * gl_Vertex).xyz;
}