#version 330 core #preinclude "vertex_data.glsl" layout (location = 0) in vec3 pos; layout (location = 1) in vec2 texture_coords; layout (location = 2) in vec3 normal; out VertexData vertex_data; uniform mat4 model; uniform mat4 view; uniform mat4 projection; void main() { gl_Position = projection * view * model * vec4(pos, 1.0); vertex_data.world_space_pos = vec3(model * vec4(pos, 1.0)); vertex_data.texture_coords = texture_coords; // TODO: Do this using CPU for performance increase vertex_data.world_space_normal = mat3(transpose(inverse(model))) * normal; }