#version 430

in vec3 attr_vertex;

uniform mat4 M_mat;
uniform mat4 PV_mat;

invariant out vec4 WS_pos;


void main(void) {
	vec4 W_pos = M_mat * vec4(attr_vertex, 1.0);
	WS_pos = W_pos/W_pos.w;
	vec4 CS_pos = PV_mat * WS_pos;
	gl_Position = CS_pos;
}