This feature is not Baseline because it does not work in some of the most widely-used browsers.
The EXT_texture_norm16 extension is part of the WebGL API and provides a set of new 16-bit signed normalized and unsigned normalized formats (fixed-point texture, renderbuffer and texture buffer).
When this extension is enabled:
WebGLRenderingContext.texImage2D() and WebGLRenderingContext.texSubImage2D() methods accept new formats provided by this extension.ext.R16_EXT, ext.RG16_EXT and ext.RGBA16_EXT become available as color-renderable formats and renderbuffers and be created in these formats.WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial.
Note: This extension is only available to WebGL 2 contexts.
ext.R16_EXTRed 16-bit unsigned format. Color-renderable.
ext.RG16_EXTRG 16-bit unsigned format. Color-renderable.
ext.RGB16_EXTRGB 16-bit unsigned format.
ext.RGBA16_EXTRGBA 16-bit unsigned format. Color-renderable.
ext.R16_SNORM_EXTRed 16-bit signed normalized format.
ext.RG16_SNORM_EXTRG 16-bit signed normalized format.
ext.RGB16_SNORM_EXTRGB 16-bit signed normalized format.
ext.RGBA16_SNORM_EXTRGBA 16-bit signed normalized format.
let ext = gl.getExtension("EXT_texture_norm16");
The WebGLRenderingContext.texImage2D() method accepts new formats when EXT_texture_norm16 is enabled. Example calls:
// imageData = Uint16Array gl.texImage2D(gl.TEXTURE_2D, 0, ext.R16_EXT, 1, 1, 0, gl.RED, gl.UNSIGNED_SHORT, imageData); gl.texImage2D(gl.TEXTURE_2D, 0, ext.RG16_EXT, 1, 1, 0, gl.RG, gl.UNSIGNED_SHORT, imageData); gl.texImage2D(gl.TEXTURE_2D, 0, ext.RGB16_EXT, 1, 1, 0, gl.RGB, gl.UNSIGNED_SHORT, imageData); gl.texImage2D(gl.TEXTURE_2D, 0, ext.RGBA16_EXT, 1, 1, 0, gl.RGBA, gl.UNSIGNED_SHORT, imageData); // imageData = Int16Array gl.texImage2D(gl.TEXTURE_2D, 0, ext.R16_SNORM_EXT, 1, 1, 0, gl.RED, gl.SHORT, imageData); gl.texImage2D(gl.TEXTURE_2D, 0, ext.RG16_SNORM_EXT, 1, 1, 0, gl.RG, gl.SHORT, imageData); gl.texImage2D(gl.TEXTURE_2D, 0, ext.RGB16_SNORM_EXT, 1, 1, 0, gl.RGB, gl.SHORT, imageData); gl.texImage2D(gl.TEXTURE_2D, 0, ext.RGBA16_SNORM_EXT, 1, 1, 0, gl.RGBA, gl.SHORT, imageData);
The WebGLRenderingContext.renderbufferStorage() method accepts ext.R16_EXT, ext.RG16_EXT and ext.RGBA16_EXT as internal formats to create renderbuffers in these formats. Example calls:
gl.renderbufferStorage(gl.RENDERBUFFER, ext.R16_EXT, 1, 1); gl.renderbufferStorage(gl.RENDERBUFFER, ext.RG16_EXT, 1, 1); gl.renderbufferStorage(gl.RENDERBUFFER, ext.RGBA16_EXT, 1, 1);
| Specification |
|---|
| WebGL EXT_texture_norm16 Extension Specification> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
EXT_texture_norm16 |
87 | 87 | No | 73 | 16 | 87 | No | 62 | 16 | 14.0 | 87 | 16 |
WebGLRenderingContext.getExtension()WebGLRenderingContext.texImage2D()WebGLRenderingContext.renderbufferStorage()
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_norm16