WebGL2RenderingContext: uniform[1234][uif][v]()-Methode
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die WebGL2RenderingContext.uniform[1234][uif][v]()
-Methoden der WebGL API legen die Werte der Uniform-Variablen fest.
Note:
ui
steht für unsigned integer,i
für integer,f
für float undv
für vector. Nicht alle Kombinationen sind gültig:u
kann nicht mitf
kombiniert werden. Siehe die Syntax-Tabelle unten. Entsprechender Regex:uniform[1234](u?i|f)v?
Syntax
uniform1ui(location, v0)
uniform2ui(location, v0, v1)
uniform3ui(location, v0, v1, v2)
uniform4ui(location, v0, v1, v2, v3)
uniform1fv(location, data)
uniform1fv(location, data, srcOffset)
uniform1fv(location, data, srcOffset, srcLength)
uniform2fv(location, data)
uniform2fv(location, data, srcOffset)
uniform2fv(location, data, srcOffset, srcLength)
uniform3fv(location, data)
uniform3fv(location, data, srcOffset)
uniform3fv(location, data, srcOffset, srcLength)
uniform4fv(location, data)
uniform4fv(location, data, srcOffset)
uniform4fv(location, data, srcOffset, srcLength)
uniform1iv(location, data)
uniform1iv(location, data, srcOffset)
uniform1iv(location, data, srcOffset, srcLength)
uniform2iv(location, data)
uniform2iv(location, data, srcOffset)
uniform2iv(location, data, srcOffset, srcLength)
uniform3iv(location, data)
uniform3iv(location, data, srcOffset)
uniform3iv(location, data, srcOffset, srcLength)
uniform4iv(location, data)
uniform4iv(location, data, srcOffset)
uniform4iv(location, data, srcOffset, srcLength)
uniform1uiv(location, data)
uniform1uiv(location, data, srcOffset)
uniform1uiv(location, data, srcOffset, srcLength)
uniform2uiv(location, data)
uniform2uiv(location, data, srcOffset)
uniform2uiv(location, data, srcOffset, srcLength)
uniform3uiv(location, data)
uniform3uiv(location, data, srcOffset)
uniform3uiv(location, data, srcOffset, srcLength)
uniform4uiv(location, data)
uniform4uiv(location, data, srcOffset)
uniform4uiv(location, data, srcOffset, srcLength)
Parameter
location
-
Ein
WebGLUniformLocation
-Objekt, das die Position des zu ändernden Uniform-Attributs enthält. data
,v0
,v1
,v2
,v3
-
Ein neuer Wert, der für die Uniform-Variable verwendet werden soll. Mögliche Typen:
- Eine
Number
für unsigned Integer-Werte (Methoden mitui
), Integer-Werte (Methoden miti
) oder für Floats (Methoden mitf
). - Ein
Uint32Array
für unsigned Integer-Vector-Methoden (Methoden mituiv
).
- Eine
Rückgabewert
Keiner (undefined
).
Spezifikationen
Specification |
---|
WebGL 2.0 Specification # 3.7.8 |
Browser-Kompatibilität
BCD tables only load in the browser