function draw() {
configureViewport({}, () => {
configureLinearScales(scales, () => {
applyCameraSkew({ skew }, () => {
drawTris({
vertices: tileTrisBuf,
positions: tilePositionsBuf,
count: tileFillVertices.length,
instances: tilePositions.length,
patternOpacity,
patternWidth,
fillOpacity: ~opts.indexOf("Tile fill") ? 1 : 0,
colorByKite: ~opts.indexOf("Color by kite") ? 1 : 0
});
if (~opts.indexOf("Tile edges"))
drawLines({
join: "bevel",
vertexCount: tileBorderVertices.length,
vertexAttributes: {
xy: tileBorderBuf,
tilePosition: tilePositionsBuf
},
width: 2,
color: [0, 0, 0, 1],
instances: tilePositions.length
});
drawHexGrid({
color: [0, 0, 0, 1],
width: 1,
hexOpacity,
triOpacity
});
});
});
});
}