drawHexagons = gl.regl({
vert: `
precision mediump float;
attribute vec3 position;
uniform mat4 model, view, projection;
void main () {
gl_Position = projection * view * model * vec4(position, 1);
}
`,
frag: `
precision mediump float;
uniform vec4 color;
void main () {
gl_FragColor = color; // vec4(0.2, 0.3, 0.8, 1);
}
`,
attributes: {
position: drawHexagonsArg.position,
},
uniforms: {
model: mat4.identity([]),
view: gl.regl.prop('view'),
projection: ({ viewportWidth, viewportHeight }) =>
mat4.perspective([],
Math.PI / 2,
viewportWidth / viewportHeight,
0.01,
1000),
color: gl.regl.prop("color"),
},
elements: gl.regl.prop("elements"),
cull: {
enable: true,
face: 'back'
},
})