WebGL2RenderingContext: vertexAttribI4[u]i[v]() 方法

Baseline 已廣泛支援

此功能已成熟,並可在多種裝置和瀏覽器版本上執行。自 2021 年 9 月起,所有瀏覽器均已支援此功能。

注意:此功能在 Web Workers 中可用。

WebGL2RenderingContext.vertexAttribI4[u]i[v]() 方法是 WebGL 2 API 的一部分,用於為通用頂點屬性指定整數值。

語法

js
vertexAttribI4i(index, v0, v1, v2, v3)
vertexAttribI4ui(index, v0, v1, v2, v3)
vertexAttribI4iv(index, value)
vertexAttribI4uiv(index, value)

引數

index

一個 GLuint,指定要修改的頂點屬性的位置。

v0, v1, v2, v3

一個整數 Number,表示頂點屬性的值。

value

一個 Uint32Array/Int32Array 或一系列 GLuint/GLint,用於整數向量頂點屬性值。

返回值

無(undefined)。

示例

js
gl.vertexAttribI4i(a_foobar, 10);

規範

規範
WebGL 2.0 規範
# 3.7.8

瀏覽器相容性

另見