#version 330 core

//the slice vertices are already in VIEW space, so we just need to project them
uniform mat4 mProj;

//inverted modelview matrix
uniform mat4 mInvMV;

//positions in view space
layout(location = 0) in vec4 vertPosition;

//output
out VSOutput
{
	vec4 p; //position in world space
	vec3 tex; //3d tex coord
} outData;

void main(void)
{
	//map from [-0.5,0.5] to [0,1]
	outData.p = mInvMV * vertPosition;
	outData.tex = outData.p.xyz + 0.5;
	
	gl_Position = mProj * vertPosition;
}