WEBGL_compressed_texture_s3tc WebGL working group (public_webgl 'at' khronos.org) Members of the WebGL working group 8

This extension exposes the compressed texture formats defined in the EXT_texture_compression_s3tc OpenGL extension to WebGL.

Compression formats COMPRESSED_RGB_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT1_EXT, COMPRESSED_RGBA_S3TC_DXT3_EXT, and COMPRESSED_RGBA_S3TC_DXT5_EXT may be passed to the compressedTexImage2D and compressedTexSubImage2D entry points. Calling getParameter with the argument COMPRESSED_TEXTURE_FORMATS will include the 4 formats from this specification.

The following format specific restrictions must be enforced:

COMPRESSED_RGB_S3TC_DXT1_EXT
COMPRESSED_RGBA_S3TC_DXT1_EXT

The byteLength of the ArrayBufferView, pixels, passed to either compressedTexImage2D or compressedTexSubImage2D must match the following equation:

floor((width + 3) / 4) * floor((height + 3) / 4) * 8

If it is not an INVALID_VALUE error is generated.

When level equals zero width and height must be a multiple of 4. When level is greater than 0 width and height must be 0, 1, 2 or a multiple of 4.

If they are not an INVALID_OPERATION error is generated.

For compressedTexSubImage2D xoffset and yoffset must be a multiple of 4 and width must be a multiple of 4 or equal to the original width of the level. height must be a multiple of 4 or equal to the original height of the level. If they are not an INVALID_OPERATION error is generated.

COMPRESSED_RGBA_S3TC_DXT3_EXT
COMPRESSED_RGBA_S3TC_DXT5_EXT

The byteLength of the ArrayBufferView, pixels, passed to either compressedTexImage2D or compressedTexSubImage2D must match the following equation:

floor((width + 3) / 4) * floor((height + 3) / 4) * 16

If it is not an INVALID_VALUE error is generated.

When level equals zero width and height must be a multiple of 4. When level is greater than 0 width and height must be 0, 1, 2 or a multiple of 4.

If they are not an INVALID_OPERATION error is generated.

For compressedTexSubImage2D xoffset and yoffset must be a multiple of 4 and width must be a multiple of 4 or equal to the original width of the level. height must be a multiple of 4 or equal to the original height of the level. If they are not an INVALID_OPERATION error is generated.

[NoInterfaceObject] interface WEBGL_compressed_texture_s3tc { /* Compressed Texture Formats */ const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; }; Initial revision. Moved from draft to community approved status Ratified by Khronos Board of Promoters. Clarified that length of ArrayBufferView is actually byteLength. Added NoInterfaceObject extended attribute.