#version 430

// tess control

layout(vertices = 3) out;

// TODO: how can we maybe generate this block maybe?
in vec4 vCoords[];
in vec3 vNorm[];
in vec3 vWorldNorm[];
in vec3 vLocalPos[];
in vec4 vWorldPos[];

out vec4 tcCoords[];
out vec3 tcNorm[];
out vec3 tcWorldNorm[];
out vec3 tcLocalPos[];
out vec4 tcWorldPos[];

uniform float TessLevelInner;
uniform float TessLevelOuter;

#define ID gl_InvocationID

void main()
{
	tcCoords[ID] = vCoords[ID];
	tcNorm[ID] = vNorm[ID];
	tcWorldNorm[ID] = vWorldNorm[ID];
	tcLocalPos[ID] = vLocalPos[ID];
	tcWorldPos[ID] = vWorldPos[ID];

	if (ID == 0) {
		gl_TessLevelInner[0] = TessLevelInner;
		gl_TessLevelOuter[0] = TessLevelOuter;
		gl_TessLevelOuter[1] = TessLevelOuter;
		gl_TessLevelOuter[2] = TessLevelOuter;
	}
}
