WebGLShaderPrecisionFormat
WebGLShaderPrecisionFormat 接口是WebGL API 的一部分,它表示通过调用
WebGLRenderingContext.getShaderPrecisionFormat()
(en-US)返回信息的信息。属性
WebGLShaderPrecisionFormat.rangeMin
(en-US)- 以2为底的最小值的绝对值的对数。
WebGLShaderPrecisionFormat.rangeMax
(en-US)- 可以表示的最大值的绝对值的底数为2的对数。
WebGLShaderPrecisionFormat.precision
(en-US)- 可以表示的精度位的数目。对于整数类型,这个值总是0。
示例
WebGLShaderPrecisionFormat
对象通过WebGLRenderingContext.getShaderPrecisionFormat()
(en-US) 方法来返回。
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 }
规格
规格 | 状态 | 注释 |
---|---|---|
WebGL 1.0 WebGLShaderPrecisionFormat |
Recommendation | Initial definition. |
浏览器兼容性
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.