EXT_color_buffer_float extension
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.
TheEXT_color_buffer_float extension is part ofWebGL and adds the ability to render a variety of floating point formats.
WebGL extensions are available using theWebGLRenderingContext.getExtension() method. For more information, see alsoUsing Extensions in theWebGL tutorial.
Note:This extension is available toWebGL 2 contexts only.
ForWebGL 1, see theEXT_color_buffer_half_float andWEBGL_color_buffer_float extensions.
In this article
Extended methods
The following sized formats becomecolor-renderable:
gl.R16F,gl.RG16F,gl.RGBA16F,gl.R32F,gl.RG32F,gl.RGBA32F,gl.R11F_G11F_B10F.
Color-renderable means:
- The
WebGLRenderingContext.renderbufferStorage()method now accepts these formats. - Framebuffers with attached textures of these formats may now beFRAMEBUFFER_COMPLETE.
Examples
gl must be aWebGL2RenderingContext. This extension does not work in WebGL 1 contexts.
js
const ext = gl.getExtension("EXT_color_buffer_float");gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA16F, 256, 256);Specifications
| Specification |
|---|
| WebGL EXT_color_buffer_float Extension Specification> |