WEBGL_compressed_texture_pvrtc
WebGL working group (public_webgl 'at' khronos.org)
Members of the WebGL working group
Last modified date: March 28, 2022
Revision: 5
WebGL extension #13
Written against the WebGL API 1.0 specification.
Note: this extension is deprecated. On systems that support this compressed texture format, please consider using the WEBGL_compressed_texture_etc or WEBGL_compressed_texture_astc formats instead. They are more widely supported and offer a larger range of quality controls.
This extension exposes the compressed texture formats defined in the IMG_texture_compression_pvrtc OpenGL extension to WebGL.
When this extension is enabled:
COMPRESSED_RGB_PVRTC_4BPPV1_IMG
,
COMPRESSED_RGB_PVRTC_2BPPV1_IMG
, COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
, and
COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
may be passed to
the compressedTexImage2D
and compressedTexSubImage2D
entry points.
getParameter
with the argument COMPRESSED_TEXTURE_FORMATS
will include the 4 formats from this specification.
The following format-specific restrictions apply to all of the formats described by this extension:
In compressedTexImage2D
, the width
and height
parameters must be powers of two. Otherwise, an INVALID_VALUE error is generated.
In compressedTexSubImage2D
, the width
and height
parameters must be equal to the current values of the existing texture image, and the
xoffset
and yoffset
parameters must be zero.
Otherwise, an INVALID_VALUE error is generated.
The following format-specific restrictions must also be enforced:
The byteLength
of the ArrayBufferView, pixels
, passed to
either compressedTexImage2D
or compressedTexSubImage2D
must be
equal to the following number of bytes:
max(width, 8) * max(height, 8) / 2
If it is not, an INVALID_VALUE
error is generated.
The byteLength
of the ArrayBufferView, pixels
, passed to
either compressedTexImage2D
or compressedTexSubImage2D
must be
equal to the following number of bytes:
max(width, 16) * max(height, 8) / 4
If it is not, an INVALID_VALUE
error is generated.
[Exposed=(Window,Worker), LegacyNoInterfaceObject] interface WEBGL_compressed_texture_pvrtc { /* Compressed Texture Formats */ const GLenum COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00; const GLenum COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01; const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02; const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03; };
Revision 1, 2012/08/07
Revision 2, 2013/07/03
Revision 3, 2014/06/27
Revision 4, 2014/07/15
Revision 5, 2022/03/28