vertexShader = {
const shader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(shader, `
precision highp float;
const float PI = 3.14159265359;
const float a = -2.0;
const float b = -2.0;
const float c = -1.2;
const float d = 2.0;
attribute vec2 position;
void main() {
float x1, x2 = position.x;
float y1, y2 = position.y;
for (int i = 0; i < 8; i++) {
x1 = x2, y1 = y2;
x2 = sin(a * y1) - cos(b * x1);
y2 = sin(c * x1) - cos(d * y1);
}
gl_Position = vec4(x2 / 2.0, y2 / 2.0, 0.0, 1.0);
gl_PointSize = 1.0;
}
`);
gl.compileShader(shader);
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) throw gl.getShaderInfoLog(shader);
invalidation.then(() => gl.deleteShader(shader));
return shader;
}