WebGLShaderPrecisionFormat: precision 属性
注意:此功能在 Web Workers 中可用。
只读的 WebGLShaderPrecisionFormat.precision 属性返回可表示的精度位数。
对于整数格式,此值始终为 0。
示例
js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");
gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision; // 23
gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT).precision; // 0
规范
| 规范 |
|---|
| WebGL 规范 # DOM-WebGLShaderPrecisionFormat-precision |
浏览器兼容性
加载中…