d(vec4 clipspace) {
  return any(lessThan(clipspace.xyz, -clipspace.www)) ||
         any(greaterThan(clipspace.xyz, clipspace.www));
}

void main() {
  gl_Position = matrix * position;
  vec4 clipPosition1 = matrix * position1;
  vec4 clipPosition2 = matrix * position2;
  
  bool clipped = vertexClipped(gl_Position) ||
                 vertexClipped(clipPosition1) ||
                 vertexClipped(clipPosition2);
                 
  if (clipped) {
     gl_Position = vec4(vec3(2), 1); // some offscreen valu