Open webciter opened 6 years ago
I was having the same issue and got around it using this
// this.canvas is the canvas created with glfx
getPixels() {
let texture = this.canvas._.texture,
gl = texture.gl,
size = texture.width * texture.height * 4,
pixels = new Uint8Array(size);
texture.use();
gl.defaultShader.drawRect();
gl.readPixels(0, 0, texture.width, texture.height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
return pixels;
}
i used chunks of the source code from Canvas.toImage
Error: WebGL warning: readPixels: Incompatible format or type. When using the getPixelArray(). I need the function getImageData() from the context how can i get this.