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 |
瀏覽器相容性
載入中…