()
| 133 | const mesh = new Mesh(gl, { geometry, program }); |
| 134 | |
| 135 | function resize() { |
| 136 | const scale = 1; |
| 137 | renderer.setSize( |
| 138 | container.offsetWidth * scale, |
| 139 | container.offsetHeight * scale |
| 140 | ); |
| 141 | const resUniform = program.uniforms.uResolution.value as Float32Array; |
| 142 | resUniform[0] = gl.canvas.width; |
| 143 | resUniform[1] = gl.canvas.height; |
| 144 | resUniform[2] = gl.canvas.width / gl.canvas.height; |
| 145 | } |
| 146 | window.addEventListener("resize", resize); |
| 147 | resize(); |
| 148 |