#version 140

in highp vec4 position;
in mediump vec3 normal;

in mediump mat4 mtx_world;
in mediump mat4 mtx_normal;

out highp vec4 var_world_pos;
out mediump vec3 var_world_normal;

uniform vs_uniforms {
  mediump mat4 mtx_view;
  mediump mat4 mtx_proj;
};

void main() {
  vec4 world_pos = mtx_world * vec4(position.xyz, 1.0);
  var_world_pos = world_pos;
  var_world_normal = (mtx_world * vec4(normal, 0.0)).xyz;
  gl_Position = mtx_proj * mtx_view * world_pos;
}