 		w3 /= w3.w;
 		
 		// cull patches outside the view frustum
-		// TODO: sample height map and adjust corners
 		if((!inBox(w0) && !inBox(w1) && !inBox(w2) && !inBox(w3))) {
 			
 			// discard the patch entirely


	if(gl_InvocationID == 0) {
		mat4 mvp = mProj * mView;
		vec4 w0 = mvp * gl_in[0].gl_Position;
		vec4 w1 = mvp * gl_in[1].gl_Position;
		vec4 w2 = mvp * gl_in[2].gl_Position;
		vec4 w3 = mvp * gl_in[3].gl_Position;
		
		w0 /= w0.w;
		w1 /= w1.w;


layout (vertices = 4) out;

uniform sampler2DArray sHeightMap;


uniform perViewData {
	mat4 mView;
	mat4 mProj;
