
uniform mat4 PROJECTION_MATRIX;
uniform mat4 VIEW_MATRIX;
uniform mat4 WORLD_MATRIX;

attribute vec4 vertex_position;
attribute vec4 vertex_colour;
attribute vec2 vertex_texture;

varying vec4 lit_vertex_colour;
varying vec2 v_texture_coord;

void main()
{
  mat4 MODELVIEW = VIEW_MATRIX * WORLD_MATRIX;
  mat4 MVP = PROJECTION_MATRIX * MODELVIEW;

  vec3 light_colour = vec3(vertex_colour.rgb);

  // Adjust vertex colour based on visibility (AFTER shading to blend right)
  lit_vertex_colour = vec4(light_colour, vertex_colour.a);
  v_texture_coord = vertex_texture;

  gl_Position = MVP * vertex_position;
}