files/en-us/web/api/webgl2renderingcontext/readbuffer/index.md
{{APIRef("WebGL")}}{{AvailableInWorkers}}
The WebGL2RenderingContext.readBuffer() method of the WebGL 2 API selects a color buffer as the
source for pixels for subsequent calls to
{{domxref("WebGLRenderingContext.copyTexImage2D", "copyTexImage2D")}},
{{domxref("WebGLRenderingContext.copyTexSubImage2D", "copyTexSubImage2D")}},
{{domxref("WebGL2RenderingContext.copyTexSubImage3D", "copyTexSubImage3D")}} or
{{domxref("WebGLRenderingContext.readPixels", "readPixels")}}.
readBuffer(source)
source
gl.BACK
gl.NONE
gl.COLOR_ATTACHMENT{0-15}
None ({{jsxref("undefined")}}).
gl.readBuffer(gl.COLOR_ATTACHMENT0);
{{Specifications}}
{{Compat}}