drawBoundaryFaces = regl2({
vert: `
precision mediump float;
attribute vec3 position,normal;
attribute float owner;
uniform mat4 view, projection;
varying vec3 N,P;
void main () {
N = normalize((view*vec4(normal, 0)).xyz);
P = (view*vec4(position, 1)).xyz;
gl_Position = projection*view*vec4(position, 1);
}
`,
frag: `
precision mediump float;
varying vec3 N,P;
void main () {
gl_FragColor = vec4(vec3(dot(N,-normalize(P))),1);
}
`,
attributes: {
position: regl2.buffer(boundaryTriangleMeshPoints[0]),
normal: regl2.buffer(boundaryTriangleMeshPoints[1]),
owner: regl2.buffer(boundaryTriangleMeshPoints[2])
},
uniforms: {},
count: boundaryTriangleMeshPoints[0].length / 3,
primitive: "triangles"
})