WebGLRenderingContext: renderbufferStorage() method

Note: This feature is available in Web Workers.

The WebGLRenderingContext.renderbufferStorage() method of the WebGL API creates and initializes a renderbuffer object's data store.

Syntax

js
renderbufferStorage(target, internalFormat, width, height)

Parameters

target

A GLenum specifying the target renderbuffer object. Possible values:

gl.RENDERBUFFER

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

internalFormat

A GLenum specifying the internal format of the renderbuffer. Possible values:

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

When using the WEBGL_color_buffer_float extension:

When using the EXT_sRGB extension:

When using a WebGL 2 context and the EXT_color_buffer_float extension:

width

A GLsizei specifying the width of the renderbuffer in pixels.

height

A GLsizei specifying the height of the renderbuffer in pixels.

Return value

None (undefined).

Examples

js
gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 256, 256);

Specifications

See also