WEBGL_compressed_texture_atc
WebGL working group (public_webgl 'at' khronos.org)
Members of the WebGL working group
Last modified date: April 25, 2018
Revision: 6
WebGL extension #12
Written against the WebGL API 1.0 specification.
This extension exposes the compressed texture formats defined in the AMD_compressed_ATC_texture OpenGL extension to WebGL.
When this extension is enabled:
COMPRESSED_RGB_ATC_WEBGL
,
COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL
, and
COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL
may be passed to
the compressedTexImage2D
and compressedTexSubImage2D
entry points.
These formats correspond to the 3 formats defined in the AMD_compressed_ATC_texture OpenGL
extension. Although the enum names are changed, their numeric values are the same. The correspondence
is given by this table:
WebGL format enum | OpenGL format enum | Numeric value |
---|---|---|
COMPRESSED_RGB_ATC_WEBGL | ATC_RGB_AMD | 0x8C92 |
COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL | ATC_RGBA_EXPLICIT_ALPHA_AMD | 0x8C93 |
COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL | ATC_RGBA_INTERPOLATED_ALPHA_AMD | 0x87EE |
getParameter
with the argument COMPRESSED_TEXTURE_FORMATS
will include the 3 formats from this specification.
The following format-specific restrictions must be enforced:
The byteLength
of the ArrayBufferView, pixels
, passed to
compressedTexImage2D
, must be equal to the following number of bytes:
floor((width + 3) / 4) * floor((height + 3) / 4) * 8
If it is not, an INVALID_VALUE
error is generated.
The byteLength
of the ArrayBufferView, pixels
, passed to
compressedTexImage2D
, must be equal to the following number of bytes:
floor((width + 3) / 4) * floor((height + 3) / 4) * 16
If it is not, an INVALID_VALUE
error is generated.
[Exposed=(Window,Worker), LegacyNoInterfaceObject] interface WEBGL_compressed_texture_atc { /* Compressed Texture Formats */ const GLenum COMPRESSED_RGB_ATC_WEBGL = 0x8C92; const GLenum COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93; const GLenum COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE; };
Revision 1, 2012/09/11
Revision 2, 2013/07/03
Revision 3, 2014/04/17
Revision 4, 2014/06/27
Revision 5, 2014/07/15
Revision 6, 2018/04/25