WebGL
Khronos
 

WebGL EXT_color_buffer_half_float Extension Specification

Name

EXT_color_buffer_half_float

Contact

WebGL working group (public_webgl 'at' khronos.org)

Contributors

Mark Callow, HI Corporation

Members of the WebGL working group

Version

Last modified date: December 02, 2022
Revision: 9

Number

WebGL extension #14

Dependencies

Written against the WebGL API 1.0 specification.

In WebGL 1.0 contexts, implementations must also support the OES_texture_half_float extension.

Overview

This extension exposes the EXT_color_buffer_half_float functionality to WebGL.

The following WebGL-specific behavioral changes apply:

Consult the above extension for documentation, issues and new functions and enumerants.

When this extension is enabled:

IDL

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface EXT_color_buffer_half_float {
  const GLenum RGBA16F_EXT = 0x881A;
  const GLenum RGB16F_EXT = 0x881B;
  const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
  const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
}; // interface EXT_color_buffer_half_float
  

New Tokens

undefined renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)

In WebGL 1.0 contexts, RGB16F_EXT and RGBA16F_EXT are accepted as the internalformat parameter.

In WebGL 2.0 contexts, RGBA16F, RG16F, and R16F are accepted as the internalformat parameter.

any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname)

In WebGL 1.0 contexts, FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT is accepted as the pname parameter.

An INVALID_OPERATION error is generated if attachment is DEPTH_STENCIL_ATTACHMENT and pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT.

Additions to the WebGL Specification

In section 5.13.12 Reading back pixels, change the allowed format and types table to:

frame buffer type format type
normalized fixed-point RGBA UNSIGNED_BYTE
floating-point RGBA FLOAT

Change the paragraph beginning "If pixels is null ..." to

If frame buffer type is not that indicated in the table for the format and type combination, an INVALID_OPERATON error is generated. If pixels is null ...

Revision History

Revision 1, 2012/11/08

Revision 2, 2012/11/13

Revision 3, 2012/11/26

Revision 4, 2014/07/15

Revision 5, 2014/11/24

Revision 6, 2016/05/05

Revision 7, 2017/09/14

Revision 8, 2020/08/31

Revision 9, 2022/12/02