drawMe = regl({
frag: `
precision mediump float;
varying vec3 vcolor;
varying vec2 uv;
uniform sampler2D redpanda;
void main () {
//gl_FragColor = vec4(vcolor,1.0);
gl_FragColor = texture2D(redpanda, uv);
}`,
vert: `
precision mediump float;
attribute vec2 position;
attribute vec3 color;
attribute vec2 a_uv;
varying vec3 vcolor;
varying vec2 uv;
uniform mat4 screen2unit;
void main () {
gl_PointSize = 5.0;
gl_Position = screen2unit * vec4(position,0.0,1.0);
uv = a_uv;
vcolor = color;
}`,
attributes: {
position: positions,
color: positions.map(() => [Math.random(), Math.random(), Math.random()]),
a_uv
},
elements: triangles,
uniforms: {
screen2unit,
redpanda,
},
count: triangles.length * 3,
lineWidth: 1,
primitive: 'triangles',
})