

layout(location = 0) in vec3 os_pos;
layout(location = 1) in vec3 os_norm;
layout(location = 2) in vec2 os_uv0;

uniform mat4 mvp;
uniform mat4 modelmat;
uniform mat4 modelmatIT;
uniform vec4 ws_lightpos;

out vec3 ws_norm;
out vec3 ws_lightvec;
out vec2 uv0;

void main()
{
	gl_Position =  mvp * vec4( os_pos, 1 );

	ws_norm = normalize( ( modelmatIT * vec4(os_norm,0) ).xyz );

	vec3 ws_pos = (modelmat * vec4(os_pos,1)).xyz;
	ws_lightvec = ws_lightpos.xyz - ws_pos;

	uv0 = os_uv0;
}
