WebGLRenderingContext: framebufferRenderbuffer() method

Note: This feature is available in Web Workers.

The WebGLRenderingContext.framebufferRenderbuffer() method of the WebGL API attaches a WebGLRenderbuffer object to a WebGLFramebuffer object.

Syntax

js
framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer)

Parameters

target

A GLenum specifying the binding point (target) for the framebuffer. Possible values:

gl.FRAMEBUFFER

Collection buffer data storage of color, alpha, depth and stencil buffers used to render an image.

When using a WebGL 2 context, the following values are available additionally:

gl.DRAW_FRAMEBUFFER

Equivalent to gl.FRAMEBUFFER. Used as a destination for drawing, rendering, clearing, and writing operations.

gl.READ_FRAMEBUFFER

Used as a source for reading operations.

attachment

A GLenum specifying the attachment point for the render buffer. Possible values:

When using a WebGL 2 context, the following values are available additionally:

When using the WEBGL_draw_buffers extension:

renderbuffertarget

A GLenum specifying the binding point (target) for the render buffer. Possible values:

gl.RENDERBUFFER

Buffer data storage for single images in a renderable internal format.

renderbuffer

A WebGLRenderbuffer object to attach.

Return value

None (undefined).

Exceptions

Examples

js
gl.framebufferRenderbuffer(
  gl.FRAMEBUFFER,
  gl.COLOR_ATTACHMENT0,
  gl.RENDERBUFFER,
  renderbuffer,
);

Specifications

See also