WebGLShaderPrecisionFormat

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

Hinweis: Diese Funktion ist in Web Workers verfügbar.

Die WebGLShaderPrecisionFormat-Schnittstelle ist Teil der WebGL API und stellt die Informationen dar, die beim Aufruf der Methode WebGLRenderingContext.getShaderPrecisionFormat() zurückgegeben werden.

Instanzeigenschaften

WebGLShaderPrecisionFormat.rangeMin Schreibgeschützt

Der Logarithmus zur Basis 2 des absoluten Wertes des minimalen darstellbaren Werts.

WebGLShaderPrecisionFormat.rangeMax Schreibgeschützt

Der Logarithmus zur Basis 2 des absoluten Wertes des maximalen darstellbaren Werts.

WebGLShaderPrecisionFormat.precision Schreibgeschützt

Die Anzahl der darstellbaren Präzisionsbits. Für ganzzahlige Formate ist dieser Wert immer 0.

Beispiele

Ein WebGLShaderPrecisionFormat-Objekt wird von der Methode WebGLRenderingContext.getShaderPrecisionFormat() zurückgegeben.

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

Spezifikationen

Specification
WebGL Specification
# 5.12

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
WebGLShaderPrecisionFormat
precision
rangeMax
rangeMin
Available in workers
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

Siehe auch