diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/webglshaderprecisionformat | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/webglshaderprecisionformat')
-rw-r--r-- | files/zh-cn/web/api/webglshaderprecisionformat/index.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/webglshaderprecisionformat/index.html b/files/zh-cn/web/api/webglshaderprecisionformat/index.html new file mode 100644 index 0000000000..ad2c22869a --- /dev/null +++ b/files/zh-cn/web/api/webglshaderprecisionformat/index.html @@ -0,0 +1,56 @@ +--- +title: WebGLShaderPrecisionFormat +slug: Web/API/WebGLShaderPrecisionFormat +translation_of: Web/API/WebGLShaderPrecisionFormat +--- +<div><strong>WebGLShaderPrecisionFormat</strong> 接口是<a href="/en-US/docs/Web/API/WebGL_API">WebGL API</a> 的一部分,它表示通过调用{{domxref("WebGLRenderingContext.getShaderPrecisionFormat()")}}返回信息的信息。</div> + +<h2 id="属性">属性</h2> + +<dl> + <dt>{{domxref("WebGLShaderPrecisionFormat.rangeMin")}}</dt> + <dd>以2为底的最小值的绝对值的对数。</dd> + <dt>{{domxref("WebGLShaderPrecisionFormat.rangeMax")}}</dt> + <dd>可以表示的最大值的绝对值的底数为2的对数。</dd> + <dt>{{domxref("WebGLShaderPrecisionFormat.precision")}}</dt> + <dd>可以表示的精度位的数目。对于整数类型,这个值总是0。</dd> +</dl> + +<h2 id="示例">示例</h2> + +<p><code>WebGLShaderPrecisionFormat</code> 对象通过{{domxref("WebGLRenderingContext.getShaderPrecisionFormat()")}} 方法来返回。</p> + +<pre class="brush: js">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 } +</pre> + +<h2 id="规格">规格</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">规格</th> + <th scope="col">状态</th> + <th scope="col">注释</th> + </tr> + <tr> + <td>{{SpecName('WebGL', "#5.12", "WebGLShaderPrecisionFormat")}}</td> + <td>{{Spec2('WebGL')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p> + +<p>{{Compat("api.WebGLShaderPrecisionFormat")}}</p> + +<h2 id="另请参阅">另请参阅</h2> + +<ul> + <li>{{domxref("WebGLRenderingContext.getShaderPrecisionFormat()")}}</li> +</ul> |