Allows to read pixels from webgl2 context asynchronously
npm install webgl-read-pixels-asyncBasically, this is an implementations from MDN's example of reading pixels from webgl2 context asynchronously
``bash`
npm install webgl-read-pixels-async
`javascript
const {readPixelsAsync} from 'webgl-read-pixels-async';
const gl = canvas.getContext('webgl2');
const width = canvas.width;
const height = canvas.height;
const pixels = new Uint8Array(width height 4);
readPixelsAsync(gl, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels)
.then(() => {
// do something with pixels
});
``