We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


The WebGLShaderPrecisionFormat interface is part of the WebGL API and represents the information returned by calling the WebGLRenderingContext.getShaderPrecisionFormat() method.


The base 2 log of the absolute value of the minimum value that can be represented.
The base 2 log of the absolute value of the maximum value that can be represented.
The number of bits of precision that can be represented. For integer formats this value is always 0.


A WebGLShaderPrecisionFormat object is returned by the WebGLRenderingContext.getShaderPrecisionFormat() method.

var canvas = document.getElementById('canvas'); 
var gl = canvas.getContext('webgl');
gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT);
// WebGLShaderPrecisionFormat { rangeMin: 127, rangeMax: 127, precision: 23 }


Specification Status Comment
WebGL 1.0
The definition of 'WebGLShaderPrecisionFormat' in that specification.
Recommendation Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support912411125.1
Available in workers No No441 No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes25 Yes Yes128.1 ?
Available in workers No No No No No No ?
rangeMin Yes25 Yes Yes128.1 ?
rangeMax Yes25 Yes Yes128.1 ?
precision Yes25 Yes Yes128.1 ?

1. From version 44: this feature is behind the gfx.offscreencanvas.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

See also

Document Tags and Contributors

 Contributors to this page: fscholz, nmve, teoli
 Last updated by: fscholz,