The current draw buffers. false
represents no buffer, true
represents the back buffer, and an integer represents the corresponding color buffer.
BadValueError if too many draw buffers are specified for the current environment.
The height of this framebuffer.
The attachment that is currently bound to the current read buffer.
The width of this framebuffer.
Attach a 2D texture to this framebuffer.
Specify the depth attachment, the stencil attachment, the depth stencil attachment, or the index of a color attachment.
The texture to attach.
Optional
_: unknownAn unused value.
Optional
level: numberThe level of the texture to attach. Defaults to the top level.
Optional
layer: numberThe layer of the texture to attach, or undefined
for the entire texture.
BadValueError if the size of the texture does not match the size of any existing attachment to the framebuffer.
Attach a face of a cubemapped texture to this framebuffer.
Specify the depth attachment, the stencil attachment, the depth stencil attachment, or the index of a color attachment.
The texture to attach.
The face of the cubemapped texture to attach.
Optional
level: numberThe level of the texture to attach. Defaults to the top level.
Optional
layer: numberThe layer of the texture to attach, or undefined
for the entire texture.
BadValueError if the size of the texture does not match the size of any existing attachment to the framebuffer.
Attach a renderbuffer to this framebuffer.
Specify the depth attachment, the stencil attachment, the depth stencil attachment, or the index of a color attachment.
The renderbuffer to attach.
BadValueError if the size of the renderbuffer does not match the size of any existing attachment to the framebuffer.
Clear the specified buffers to the specified values.
The value to clear the color buffer to or a boolean to use the previous clear color.
The value to clear the depth buffer to or a boolean to use the previous clear depth.
The value to clear the stencil buffer to or a boolean to use the previous clear stencil.
Draw the vertex data contained within a vertex array object.
The vertex array object that contains the data to be drawn.
Optional
uniforms: UniformMapA collection of uniform values to set prior to rasterization.
The type of primitive to rasterize.
The number of elements to skip when rasterizing arrays, or the number of indices to skip when rasterizing elements.
Optional
countOverride: numberThe number of indices or elements to be rendered. Automatically renders all supplied data if undefined
.
BadValueError if a uniform is passed undefined
as a value or if an unknown uniform is specified.
Read pixels from this framebuffer.
Optional
rectangle: RectangleThe rectangle of pixels to read. Defaults to the entire read buffer.
Optional
rgba: booleanWhether to output RGBA data (as opposed to using the format of the read buffer). Defaults to false
.
Optional
packAlignment: 1 | 2 | 4 | 8The alignment to use when packing the data, or undefined
to let this be automatically determined.
Optional
out: undefinedThe buffer or typed array to store the pixel data in.
Optional
offset: numberThe offset at which to start storing pixel data in the buffer or typed array.
A typed array of pixel data.
Read pixels from this framebuffer.
The rectangle of pixels to read. Defaults to the entire read buffer.
Whether to output RGBA data (as opposed to using the format of the read buffer). Defaults to false
.
The alignment to use when packing the data, or undefined
to let this be automatically determined.
The buffer or typed array to store the pixel data in.
Optional
offset: numberThe offset at which to start storing pixel data in the buffer or typed array.
The buffer or typed array to store the pixel data in.
A portion of contiguous memory that contains a collection of buffers that store color, alpha, depth, and stencil information that is used to render an image.
See
WebGLFramebuffer